Enemy movement

Get help using Construct 2

Post » Sat May 19, 2012 12:54 pm

in this example i am trying to get the player character to snap to the direction of the arrows, but i cant get it to work

ive tried to set the characters position to the arrows position but the bullet movement wont change direction

im sure im just missing something simple but i cant find the answer anywhere

here's my example



example

this should be the capx file example capx



i can get the character to move in the right direction if i spawn another object but can it be done using the same object?darksteeldanger2012-05-19 13:07:55
B
10
S
1
G
1
Posts: 74
Reputation: 1,637

Post » Sat May 19, 2012 1:52 pm

I think this is what you want...

http://dl.dropbox.com/u/41931267/Postman.capxsqiddster2012-05-19 13:52:57
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun May 20, 2012 10:12 am

for some reason i cant open the file

its saying i need version 91 ive just updated but its only given me version90

frustration...........

B
10
S
1
G
1
Posts: 74
Reputation: 1,637

Post » Sun May 20, 2012 10:16 am

http://www.scirra.com/construct2/releases/r91

Try to download beta, you will love these new features
B
96
S
25
G
20
Posts: 3,054
Reputation: 22,642

Post » Sun May 20, 2012 10:58 am

thankyou sir
B
10
S
1
G
1
Posts: 74
Reputation: 1,637

Post » Sun May 20, 2012 11:08 am

well that defiantly works, but its a little confusing, if you don't mind could you tell me what the 100*dt means.
i know the * is multiply but what are you multiplying?
is it the variable that is making the bullet movement change?

im a total beginner so if its a dumb question i apologise
B
10
S
1
G
1
Posts: 74
Reputation: 1,637

Post » Sun May 20, 2012 11:34 am

OK, so there is no bullet movement, so does that mean the movement is all done in the second line? so the "move 100 * dt pixels", that's how your getting the character to move?

im gunna play around with it see what i can make of it

thanks for the help
B
10
S
1
G
1
Posts: 74
Reputation: 1,637

Post » Sun May 20, 2012 1:53 pm

dt is the time since the last tick/frame. So 100*dt means it will move 100 pixels every second, regardless of framerate.

http://www.scirra.com/tutorials/67/delta-time-and-framerate-independence/page-1
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Sun May 20, 2012 1:57 pm

i see, nice one!
B
10
S
1
G
1
Posts: 74
Reputation: 1,637


Return to How do I....?

Who is online

Users browsing this forum: flemmig, semaso, Skebab, Virpoja and 11 guests