I am creating a shooter game that is top view playing type. I'm not using any scrollers for there will be A.I.(that I have not scripted yet) and I fear it would be too difficult. But I recently came across a problem with the damage system that I was planning.
Now, in my game, There are different stages to play on. I have made a sprite that acts as obstacles, and the background changes for every stage. I put in sensors so you could not walk through the obstacles. So the problem is... the way the weapons fire in the game were made very differently so that auto fire could be possible without any delay. What they do is actually just appear and then disappear almost instantly. Now, what I was planning(which means I haven't actually scripted it yet) was when the bullet is touching an enemy, but is also touching a wall, the enemy will not take damage.
Here is an image to show what I mean and where the problem is at:
If you want a better understanding on what I mean, please download the latest update I uploaded of this game on my profile:
http://scratch.mit.edu/projects/Royah/1159090
Note that the A.I. and the damage system have NOT been scripted yet.
If you could please help me that would be great.
Again, I need to find a way so that a person in front of cover will take damage when the bullet touches him, even if the bullet is touching an obstacle, but if he is behind the obstacle, he won't take any damage.
Thanks.
Also note that the game is no where close to being finished. This is just a problem that needs to be fixed in order for me to continue.
Last edited by Royah (2010-07-01 01:04:49)
Offline
Wow, nice picture! That really helps.
Hmm... maybe if each obstacle were a separate sprite, you could check if the distance to the green enemy is less than the distance to the obstacle - but the script would need to work out what enemy and what obstacle it needs to check.
If you had a small sprite zoom across the screen, it could record all the enemies it hits and stop once it hits an obstacle. It wouldn't be related to the way you're having bullets fire, but it might work.
It works by going across the screen and recording what enemies it hits. It stops when it hits an obstacle, so it won't record any enemies behind obstacles.
If you don't want to create three variables for checking if the enemies have been recorded yet, you can use three items in a list.
Last edited by Jonathanpb (2010-07-01 02:23:23)
Offline
Jonathanpb wrote:
Wow, nice picture! That really helps. :)
Hmm... maybe if each obstacle were a separate sprite, you could check if the distance to the green enemy is less than the distance to the obstacle - but the script would need to work out what enemy and what obstacle it needs to check.
If you had a small sprite zoom across the screen, it could record all the enemies it hits and stop once it hits an obstacle. It wouldn't be related to the way you're having bullets fire, but it might work.
http://img526.imageshack.us/img526/6576 … atchec.png
It works by going across the screen and recording what enemies it hits. It stops when it hits an obstacle, so it won't record any enemies behind obstacles.
If you don't want to create three variables for checking if the enemies have been recorded yet, you can use three items in a list.
Thanks for your help.
I actually thought of your first idea, but after an experiment, I actually confused myself and thought it wouldn't work. I just tried again and it seems like it works. I might come back, however, if I come across another similar problem, but for now, thanks for your help : )
Offline
i'll say welcome from his side (he forgot MANNERS
)
Offline