How do I cap an object's max speed

Get help using Construct 2

Post » Sat Jan 02, 2016 3:04 am

Hi everyone,

So one of my resolutions this year is to return to several games I let go to the back burner last year and get these games done. one of the problems I faced with this game (FredEx) is that the physics of C2 were so responsive that I had problems with collision detection with walls.

In FredEx you flick boxes into the backs of trucks. My first attempt (seen in this video) was with GameSalad which seemed to have a generally slower less responsive physics system which in the case of this game worked in my favor. https://www.youtube.com/watch?v=gpoaJQgL5_E This was a rough early version, but notice how the mouse and the object are not locked together. There is a kind of lag because the frame rate / vsync / whatever that gamesalad was a little sluggish.

Construct 2 on the other hand is a hyper responsive so with you drag the item it's locked to your finger and flicking can result in some incredibly fast flings which in some cases would break through solid objects that should normally stop the boxes..

so... TL;DR

I need to figure out a way to have an object I drag have a max speed. I've experimented with the various physics parameters in C2, but I must be doing something wrong because everything i tried never got me anywhere and thus resulted in me abandoning taking the game further. I need to know the boxes can never get outside the dock. Throttling the objects max speed should help prevent the problem i'm having.

What I'd ideally like to see is just what you see in the video.. the boxes basically lag a little.. like they can't keep up with my finger if i move too fast.. and of course if i move slowly then they can catch up.

one of the latest versions of the game can be seen here. I have all the assets I need to get this game pulled together if i could just master this dragging https://www.youtube.com/watch?v=jBk2CPETZyk

Thanks!
Caleb
B
59
S
9
G
1
Posts: 970
Reputation: 6,611

Post » Sat Jan 02, 2016 10:22 pm

bump. there must be a way to have an object have a speed throttle somehow.
B
59
S
9
G
1
Posts: 970
Reputation: 6,611

Post » Sun Jan 03, 2016 12:48 am

Just set angle towards the mouse/touch on selected and set a max speed..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Jan 14, 2016 11:42 am

@littlestain thanks for this. I'll try it out. I've been working in Cocoon IO lately to get a couple of projects wrapped up so I hadn't had a chance to test this out.

Thanks!
Caleb
B
59
S
9
G
1
Posts: 970
Reputation: 6,611


Return to How do I....?

Who is online

Users browsing this forum: draiza, Kyatric, R0J0hound, zenox98 and 8 guests