trouble manually control platform behavior(help with logic)

For questions about using Classic.

Post » Sat Jul 10, 2010 11:30 pm

trying to make sprite go to 'goalx' and accelerate within the limits of normal platform movement
can anybody see why this doesn't work (it's all one line, but it's line broken for readability):


Set Sprite Platform X Component of Motion
[code:lgay6mab]clamp(sprite('goalx')-sprite.x,

max((sprite[Platform].VectorX-(1000*timedelta*sprite[Platform].FloorAccRate)),0-sprite[Platform].MaxFloorSpeed),

min((sprite[Platform].VectorX+(1000*timedelta*sprite[Platform].FloorAccRate)),sprite[Platform].MaxFloorSpeed))[/code:lgay6mab]

here's an example cap of it not working
hover the mouse over the blue box to use regular platform controls with the arrow keys
or click somewhere to watch the sprite move with the algorithm above to where you clicked
[url:lgay6mab]http://dl.dropbox.com/u/1013446/notwork.cap[/url:lgay6mab]
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests