Pages: 1
When my bullet is fired, instead of just stopping when hitting one enemy, it just penetrates it and destroy everything in its path. I need to make so that one bullet kills only one enemy. What am I doing wrong here?
My script for bullet:
when green flag clicked
go to barrel
hide
forever
if key space pressed
point in direction direction of barrel
go to barrel
show
repeat until touching edge or touching color of the enemy
move 10 steps
if touching color of the enemy
hide
go to barrel
if touching edge
hide
go to barrel
Offline
could you give me a little more details, plz?
Offline
Without being able to see the project's full scripts, these are the most details I can give.
Make sure this script(Or something like it; adapt to your needs) is in the enemy.
when gf clicked forever if <touching [bullet v]?> put the script that makes the enemy die here broadcast [enemykilled v] and wait endAnd put this in the bullet:
when I receive [enemykilled v] go to [barrel v]If you upload the project that you need help with, I can probably give more details.
Last edited by laser314 (2012-11-30 13:45:02)
Offline
laser314 wrote:
when I receive [enemykilled v] go to [barrel v]
A better script for what you want would be:
when I receive [enemykilled v] glide (1) secs to x:<[x position v]of[barrel v]>y:<[y position v]of[barrel v]>
Last edited by JH1010 (2012-11-30 14:48:28)
Offline
Offline
Put at the bullet something like this
[When I recieve Shoot]
[Set Direction to Direction of Gun]
[repeat until [ [touching enemy] or [touching edge] ]
[ ] [move 1 step]
[ ] [ ] [ ] [ ]
[Go to sprite gun]
That's what I'd use, no variables or broadcasts required ^^
Offline
JH1010 wrote:
laser314 wrote:
when I receive [enemykilled v] go to [barrel v]A better script for what you want would be:
when I receive [enemykilled v] glide (1) secs to x:<[x position v]of[barrel v]>y:<[y position v]of[barrel v]>[/quote] How is that better?Last edited by laser314 (2012-12-01 00:23:36)
2.0 Alpha Tester!
Offline
Pages: 1