Need help working out an algorithm... [SOLVED]

For questions about using Classic.

Post » Thu Apr 07, 2011 1:07 am

Alright, I'm working on an addition to a feature in my Mario game, hitting ? Blocks. My problem? I didn't actually do the initial events myself, and don't really know how they work. :P Some very helpful person here helped me do it a while back, and it works fine. Here's what that guy did:



That makes the ? Blocks bounce upwards when you hit them from the bottom, and then return to their original position. Now what I'm trying to do is the exact opposite -- if you use a ground pound from the top, they bounce downwards, and then go back up to the same spot. I got that to work on its own, but when I try to implement both at once, I can't get it to work at all -- hitting it from the top OR bottom does nothing.

So, uh... help please? :)
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Thu Apr 07, 2011 5:23 am

I've been needing an a to b to a movement for a while, but until we get one there's always a state machine.
[url:1d13idwv]http://dl.dropbox.com/u/666516/queenofb.cap[/url:1d13idwv]
In this case the state is either over or under the block.
The cap should be a little easier to understand, if you get lerp.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Fri Apr 08, 2011 2:57 pm

Got it working, thanks. :) I don't really understand what lerp is doing, but I think I get the gist of it...
B
20
S
9
G
6
Posts: 607
Reputation: 6,112


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests