Question about a (simple) animation.

For questions about using Classic.

Post » Tue Jan 31, 2012 3:56 am

Hey everybody!
So I was working on a game 100% made by me (I know, very exciting!). So far everything is going very smoothly, until I get to my "sliding" animation. What I want to do is allow the player to slide on the ground for a short amount of time when both down and C are pressed (while Karo is moving), and to be able to go into smaller spaces you couldn't while just standing. Sounds easy right? Problem is I can't do either of these relatively simple actions. Maybe one of you guys can help me out? The most important thing is to get the sliding under small spaces working. Any help is appreciated! ^_^

Here is the .cap   (Please don't take my noobish artwork lol)

Arrow Keys: Move
Down: Duck
X: Jump
C: Punch
Z: Run
Z + X (While moving): Flip
Up + C (In the air): High Jump
Down + C (while moving on the ground): Slide (the problem)
Posts: 18
Reputation: 386

Post » Tue Jan 31, 2012 4:51 am

Hi, because you've got 'is moving' as a condition on the slide he won't slide unless he's moving. If you hold forward and down and press c it works, or if you take away the 'is moving' he performs the slide animation but doesn't go anywhere. Perhaps you could store the direction he's facing as a variable and then push him a few pixels in that direction when down + c is pressed. I dunno, I'm quite new to this as well so someone might have a better suggestion. Good luck though, game is coming along nicely.
Posts: 201
Reputation: 6,862

Post » Tue Jan 31, 2012 3:22 pm

I figured it out. It was actually easier than I thought. :P
All I did was make an interactive wall that looks like the other walls. When you are sliding, the interactive wall becomes a non solid, and turns back solid when you are done sliding. I also fixed the slide animation, so that you can't slide forever! You also don't have to be moving for it to work, but instead, you have to hold down the left or right arrow key to slide. Thanks for your help though! :D *High fives*

Here is the edited cap
(Same controls as before)
Posts: 18
Reputation: 386

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests