Hi there, I’m new to Wick editor. I watched a couple of tutorials, and decided to make a basic game. An endless runner, I decided. Simple. Once you’ve got a guy jumping and blocks moving, RNG and algorithms do the rest!
I can’t even get my guy to jump! I can make him go up, but then how can I make him go down again, with a delay?
Try to use the free fall physics formula:
clip.y = y0 - ( v0 * t ) + (a * t * t)
What exactly… is that?
It is the free fall formula from physics classes…
clip.y -> is your current/instant "Y" position at jumping
y0 -> is the "Y" position from when you initially jumped.
v0 -> is the initial velocity of your jump (peek a number to beat gravity)
t -> is time. It would start at zero at the beginning of your jump, then increases frame by frame.
a -> gravity accel (chose a number that makes sense for your game and try it)
The following wick file has it implemented… (Open it using 1.18)
Click on Mario and see the script…
Oh okay, that makes sense. Would I need to define those variables elsewhere in the code?
Yeah, I noticed that something was hidden, I’ll check your project out
it got hidden again
here’s a solution. it only works if the ground is always flat.
ask me if you are confused, i don’t have much time right now.
Thanks for all the solutions everyone! I’ll properly poke through them all tomorrow.
it got hidden again again again
it got deleted
if wcb’s reply got hidden, that means it was removed by the moderators, and that’s fine. don’t need to make 2 replies about it.
I don’t think so.
The moderators probably have their own reason for hiding posts, it’s not necessarily a false move.
It’s alright boys. It was a misunderstanding.
@awc95014 I looked at your example, and am a little confused. I found this code in the ball clip:
but that can’t be all of it, as this.play
isn’t defined in that code. Where is the other code? (I also saw the movement code for obstacle.)
this.play() plays the animation in the ball. if you check its timeline, you see that the first frame is an idle animation. the other frames are a jumping animation. in the default tab in the first frame of the ball’s animation, it says stop(); to lock the animation on the first frame, the idle one. when this.play(); is run, it starts the animation, the jump. then it wraps back to the first frame after the jump, stopping the animation again.
so i guess the only “hidden” code is the stop() in the first frame inside the timeline of the ball.
Ah! I never thought to look in the ball’s timeline. Thanks! Now that I think of it, that is a pretty ingenious way to make a character jump.
Man, the community here is so helpful!