在制作射击游戏时,如何清除子弹线

在制作射击游戏时,如何清除子弹线

问题描述:

问题是我现在使用turbo c ++中的图形创建了背景,而我必须使用for循环移动子弹,但问题是子弹是移动时制作一个豆子我必须清除它,所以我使用了cleardevice,但它清除了背景。所以我帮助我



我尝试过的事情:



我有从互联网上研究后尝试了许多功能来完成任务,但似乎对我有帮助

the problem is that I have created the background using graphics in turbo c++ now while I have to move a bullet using for loop but the thing is that the bullet is making a bean while moving I have to clear that so I have used cleardevice but it clears the background. so plss help me

What I have tried:

I have tried many functions to do the task after researching from the Internet but one seems to be helpfull for me

子弹是一个所谓的精灵。



要绘制这样的动画精灵,你可以

The bullet is a so called "sprite".

To draw such animated sprites you can


  1. 获取实际图像的位置应该绘制并保存子弹
  2. 在实际位置绘制子弹
  3. 等一下
  4. 通过绘制已保存的图像删除子弹
  5. 确定项目符号的下一个位置并继续执行步骤1或退出循环

可以通过在恢复旧位置之前在新位置上绘制项目符号来修改上述内容。只需要两者来检查哪种方法看起来更聪明。

The above may be modified by drawing the bullet on the new position before restoring the old position. Just do both to check which method looks smarter.