Slowdown after the mouse cursor [solved]

For questions about using Classic.

Post » Wed Jan 12, 2011 3:10 pm

I've tried to make a small space shooter game, but now I'm going back to a different project. Still, there was one problem I couldn't solve. I wanted to have the space ship moving slow from start and then during the game it's speed slowly increase by picking up bonuses. But I don't know how to make it follow the cursor with a lag. It has worked with sin and cos, but the ship always started to shake when it reached the cursor. I've made something like workaround, but shaking is still visible when switching to v-sync mode. It probably will be easy for you math guys and I can't wait to see how it's properly done.

Wheel up/down - speed up/down
LMB - shoot
RMB - rocket - also, there I found this bug

LINK
thanks in advance for any help
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Wed Jan 12, 2011 3:34 pm

B
51
S
10
G
7
Posts: 184
Reputation: 6,825

Post » Wed Jan 12, 2011 4:17 pm

Lerp's pretty handy here.
+Always
ship set position to lerp(.x,mousex,1-0.5^timedelta), lerp(.y,mousey, 1-0.5^timedelta)
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Wed Jan 12, 2011 6:04 pm

Thank you, now let me take day off to figure out what's going on .:)
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests