Posted By
|
Message
|
siven I EAT ROCKS
Registered 03/11/2008
Points 604
|
11th February, 2014 at 11/02/2014 00:10:22 -
So ive been fiddling around with it recently and i just cant seem to get it down. how do you make your character "bounce back" or get "knocked back" when you get touched by an enemy or a bullet? i dont want it to restrict the actions your character can do like shooting etc, i just want it to knock you back a little bit, maybe a little hop sort of thing and some blood splatter just to show you got hit. i dont want the character to be able to control the direction or speed in which he gets knocked, so if you get hit from the left side you move towards the right side. any ideas?
[Game design makes my brain feel like its gonna explode.]
|
Pan-tosser
Registered 24/10/2008
Points 520
|
11th February, 2014 at 11/02/2014 23:06:16 -
i haven't used the pmo object a lot. So I can't contribute to much more than a little theory. But in general it is always good to program for the zero. Which means simply to never cause a loop that can't be stopped my setting it's core values to zero.
Having zero values always cause a neutral state is awesome. Then once this is achieved with your main pmo movements.
You can have a second system that kicks in when the first is one is zero.
In my own project which is a beat'em up and not a platform. I use a fast loop and it loops the number of times my knock back value is. On the first index value it saves the x coordinate. As it loops it reads what direction the blow came from. So if the value Blow_Dir = 1, then player gets added to his x by 1. If value Blow_Dir = 2 subtract.
Then at the last loop index it sets the player back to the saved x. But you got to move it in the loop 1 pixel at a time or it looks like the player skips.
https://www.facebook.com/nathon.brown.7
|
siven I EAT ROCKS
Registered 03/11/2008
Points 604
|
13th February, 2014 at 13/02/2014 01:42:36 -
what do you mean by set the core value of the loop to 0? is that when it asks how many times to run the loop after you start it? cuz ive been setting mine to 1, and having at the very end of the loops event have it say stop loop. if i have to use multiple loops for 1 thing ill have it start the next loop and then stop the currently loop
[Game design makes my brain feel like its gonna explode.]
|
Pan-tosser
Registered 24/10/2008
Points 520
|
13th February, 2014 at 13/02/2014 03:09:53 -
I wasn't zooming in on any one coding method. It was more of general theory i was talking about. Case in point
say you have code that achieves a few goals.
-(input)
-player picks up gun
-(logic)
-game plots path to random enemy
-(input)
-player shots gun
-(logic)
-game plots path of bullet
The problem with the above chain of events or loop. Is that the neither set of logic has anyway to stop. their is no neutral state associated with them. They will over ride each other and not take turns.
A slightly better way is, (but not the only way)
-(input)
-player picks up gun
-(logic)
-game checks to see if a path has already been calculated (checks to see if its zero)
-game plots path to random enemy
-(input)
-player shots gun
-(logic)
-game checks to see if a bullet path is zero (you wouldn't want the new bullet to inherit the old bullets data)
-game plots path of bullet
Just a little theory like a said. Nothing special. Program for the zero, or clearing the buffer. What ever you would like to call it. It's just a programming design to control the flow of data. I just used the words "core value" for lack of a better term.
https://www.facebook.com/nathon.brown.7
|
Dialga-Brite
Registered 28/12/2011
Points 1257
|
13th February, 2014 at 13/02/2014 16:35:54 -
http://biancagames.com/Spiritia.mfa
this might help. look at the global events.
n/a
|
siven I EAT ROCKS
Registered 03/11/2008
Points 604
|
14th February, 2014 at 14/02/2014 00:14:41 -
@pantosser oh ok i get what your saying. good thinkin bro
@dialga-brite ill check it out when i get a chance, thanks!
[Game design makes my brain feel like its gonna explode.]
|
siven I EAT ROCKS
Registered 03/11/2008
Points 604
|
14th February, 2014 at 14/02/2014 00:33:57 -
Sorry for double post, but dialga im getting an unrecognized file format from mmf2 when i try to open that, even though it says mfa? idk why.
[Game design makes my brain feel like its gonna explode.]
|
lembi2001
Registered 01/04/2005
Points 608
|
14th February, 2014 at 14/02/2014 16:35:40 -
Originally Posted by siven Sorry for double post, but dialga im getting an unrecognized file format from mmf2 when i try to open that, even though it says mfa? idk why.
It's probably because it's a CF2.5 mfa not MMF2
n/a
|
siven I EAT ROCKS
Registered 03/11/2008
Points 604
|
21st February, 2014 at 21/02/2014 19:01:36 -
Yep, thatd be it. i cant open it than...
[Game design makes my brain feel like its gonna explode.]
|
|
|