Hey Clickteam,
You know how in Ninja Gaiden on the NES, when Ryu would get hit by an enemy or eagle or whatever, he would fly back an inch or so? How can I recreate that in the event editor? Thanks Guys!
Printable View
Hey Clickteam,
You know how in Ninja Gaiden on the NES, when Ryu would get hit by an enemy or eagle or whatever, he would fly back an inch or so? How can I recreate that in the event editor? Thanks Guys!
You can set a flag or alterable value that when the player collides with an enemy, activate the flag.
When flag is active add 1 to alt val, set player X + or - depending on direction. Then have the sprite y position - 5 + alt val that is being added. It gives it a small sense of gravity and gives you the lift before bringing the sprite back down.
Then when player collides back with the ground turn off the flag and set the alt val to 0.
you can also make a timer if you don't want the condition to be collisioning. after x time turn "pushback" flag off, or x value to 0 if you'renot using a flag. This way you can modify the lenght (or time) of the pushback depending on the attack.
Thanks guys for responding. Piscesdreams, can you clarify some of the events you are talking about please? I understand making an Alt Valve and setting players x position. But what do you mean "have the sprite y position - 5 + alt val that is being added?" Thanks.
Are you using a custom made movement setup/PMO/Built in platform movement? The way i have mine setup (can't pull it up right now, just going from memory) is having a pain group that is deactivated, and when the player collides with an enemy, it activates this group. In the pain group, i have some events set so that when facing the right direction when the group is activated, the PMO is set to jump + has an additional x velocity set at -100 i believe. The same event is used for the left facing direction, except the additional x velocity changes to 100. Also, to stop the event, i have the last bit of code saying that when the player lands on the ground, it deactivates the pain group.
If you are using the PMO, Warmachine's suggesting is probably the best way to handle it. Alternatively, instead of the x values, you could use the "user is holding input" commands to handle the direction. For instance, user collides with enemy while facing right, user jumps + user is holding left input key. Make sure the player's direction is facing right while still moving left (backwards) to maintain the appearance. Then just reverse and repeat for the other direction.
Warmachine, Shawn,
I'm not using the PMO but that sounds like the easiest way to go about this. I've been using Fusion for about a year. This will be my first Side Scrolling adventure. I'm not too familiar with PMO but I think I saw a tutorial on the website. Thanks!!!
Check out Chaos Advanced Platformer Tutorial, its a GREAT starting point for understanding how the PMO (Platform Movement Object) works. The only downside i have found to using it vs using the built in/fusion platform is that for moving objects such as things that move like pendulums or horizontal moving platforms it takes quite a bit of work to get it where it needs to be. Im still trying to figure out how to correctly make the PMO work with a pendulum platform lol. But other than that it is nothing but pros vs the built in platform movement IMO. You get soooo much more control over your objects with the PMO.
Warmachine, I hear ya about those moving platforms lol.
Once you understand what all the conditions of the PMO are and how they work, the PMO is a breeze. It's pretty flexible if you play around with the values and whatnot.
I wonder if there's a tutorial for the various types of moving platforms with the PMO? If not, somebody should make one.
here is a quick tutorial how to do something like that
http://sparckmanforums.weebly.com/up...31960_orig.jpg
http://community.clickteam.com/threads/90988-Ninja-Gaiden-Collision-Tutorial
Actually, i made one and posted it a couple of weeks ago :)
http://community.clickteam.com/threads/90652-Horizontal-Moving-Platform-using-Platform-Movement-Object-example
But i can't figure out for the life of me how to make it work correctly with a pendulum platform lol.
I am not sure about the PMO, but in my custom platform engine I just force the player x and y pixels based on the velocity and it works like a dream. You are still free to walk around on the platform and do your basic movements. Its just if the platform is moving 20 pixels, move the sprite 20 pixels.
That will work for the PMO as well. Set up an event to detect if the player is standing on the platform and then adjust the X value to match the platform's (so if the platform is moving 4 pixels at a time, player X + 4, etc). I don't fiddle with the PMO variables, I adjust the X position manually.
That works, but what doesn't really make it work at all is that the object is a pendulum and the x and y are at a stand still, but the angle is the only thing effected.
Have you tried adding a platform that attaches to an action point on the platform portion of the pendulum that detects if you're standing on it or not? If the player is on it, the best recommendation is transpose the velocity into amount of pixels being moved and then move the player sprite accordingly.
Lol great minds think alike dude, im working on that right now.