How to use 'on step' with bullet movement?

For questions about using Classic.

Post » Fri Feb 08, 2008 10:51 pm

I'm trying to set up an instant-hit shot, but it doesn't seem to work. The event is currently:

If leftmouse is down, create object 'laser', set angle to mouse location

On step and on collision between laser and enemy, destroy enemy

Thoughts?
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Sun Feb 24, 2008 5:36 am

the mouse location cannot become an angle ( coz mouse location = (x,y) and angle is (0-360)..)

hope this helps..

but u could have a "dummy sprite" that is very very invisible. that way, u could have your object point towards that dummy sprite and you could launch you laser object towards that dummy sprite.

also, the bullet movement for the laser is useful..
B
2
S
1
G
4
Posts: 31
Reputation: 1,262

Post » Sun Feb 24, 2008 5:43 am

couldn't you have the object actually spawn at mouse location, and have that object do what you want it to do?
B
2
G
4
Posts: 13
Reputation: 1,076

Post » Sun Feb 24, 2008 6:24 am

[quote="kpbotbot":3nynpigl]the mouse location cannot become an angle ( coz mouse location = (x,y) and angle is (0-360)..)

hope this helps..

but u could have a "dummy sprite" that is very very invisible. that way, u could have your object point towards that dummy sprite and you could launch you laser object towards that dummy sprite.

also, the bullet movement for the laser is useful..[/quote:3nynpigl]

What in the world are you talking about? "bullet: Set angle towards (mouseX, mouseY)" works just fine.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Feb 24, 2008 11:23 am

hehehe... i didnt see some words.. i was being stupid.. :D i didnt know u used "towards".
B
2
S
1
G
4
Posts: 31
Reputation: 1,262

Post » Sun Feb 24, 2008 4:44 pm

BTW in regards to the original problem I think you should use 'Is overlapping' instead of 'On collision':

+ On step
+ Is overlapping Object
: Destroy bullet etc.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests