tank tracks and elastic

For questions about using Classic.

Post » Wed Apr 08, 2009 7:06 am

'kay, two questions in one.

[url:3d3y7bwe]http://www.udec.cl/~jfuente_alba/Blast_code.cap[/url:3d3y7bwe]

First: I used the offset effect on a sprite to emulate top down tank tracks, but if the offset is negative it just slides away and if there's rotation involved it just goes NUTS!
Tried using a tiled background, but apparently that plugin cannot be rotated :O
Can't figure another way to do this. Any ideas?

Second: it's supposed to be a wrecking ball attached to the tank.
I've set it up so if it's out of a given radius (len_chain global) it will set the speed (Wrecking PV speedx and speedy) towards the body of the tank with a speed that depends on how far it is and an elasticity global. I also added a drag coefficient in the globals. The movement is rather wonky, has anyone a better approach? I want to achieve an elastic behaviour, after a certain distance the elastic should tense and apply force.
Tomorrow I will attempt actual force equation. Too tired now.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Wed Apr 08, 2009 8:22 am

Instead of using shader effects I'd use an animation.
[url:1dfqetgq]http://dl.getdropbox.com/u/666516/speedy.cap[/url:1dfqetgq]
Simulating movement is fairly easy to do, just make as many frames as you have segments of track, and for each frame move one segment down the line.
Image Image
B
161
S
48
G
90
Posts: 7,350
Reputation: 66,755

Post » Wed Apr 08, 2009 3:50 pm

Yeah, I'd make animation for something so simple...

If you get stuck I can make something for you quickly, it wont be hard...

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Thu Apr 09, 2009 4:00 am

Updated the .cap

Tank tracks look beautiful now :D used distortion map, doubled the sprite along the tiling direction and uv-scrolled it, resetting to wrap.

Now, I wanna have two tracks on this tank attached each to a point and set their distortions independently. Should I have two different objects with each its own image? or is there a way to manage that with instances? Tank body already has two image points.

Wrecking ball is a wreck, will implement proper elastic physics into it next time.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests