I’m new to these boards as such I will just do a quick intro, if you don’t care to know about me then scroll down a little bit and maybe you can help me out with a question.
I’m 27 years old. I spent most of my life moving from town to town. The only constant was my video games. Like most people here (I assume) I devolved a deep love and appreation for gamming of all sorts. In recent years I had joined the legion of mmo'ers. About three months ago I took a step back and realized that the quality of gamming had been declining so I stopped playing these time sinks and started to work on ideas for a game of my own.
I think Super Nintendo era of games really topped the scale of fun, after that things started to go down hill. There are of course exceptions to this but as an over all the fun in games had been replaced with "looks nice". So rather then complain about it I want to do something.
After some time penning ideas and sketching out some thoughts, it is time to get started with the "making of". So after looking around at different products I chose this one.
Now onto the question:
After working with MMF2 for a while I want to start on my first play-able game. To me the most important aspect of a game is the character control. As such I found DavidN's tutorial and worked though it with out any trouble. However there are a few pieces of movement that are not in his engine that I want to add. The most important for this stage of development is the wall jump, much like the Megaman X series.
So far I have tried to add a rule along the lines of
If pos y > 0, and over lapping background, then cut the effects of gravity by 2/3rds and reset the jump count to 0.
Mow that looks nice on paper but I just can not figure out how to set the rule in MMF2 correctly. That’s where you guys come in, if anyone could give me a little direction here that would be awesome.
This is the current Jump/Gravity portion of the code, for those of you who are not familiar with DavidN’s tutorial.
Grav of “player” < 10
“player”: Set Grav to Grav(“player”)+.045
Grav of “player” <> 0
Start loop “gravity”Abs(Grav(“player”))times
Press fire 1
“Detector” is overlapping a backdrop
“player”: Set Grav to -10
On loop “gravity”
Grav of “player” < 0
“player”: set Y position to Y (“player”)+1
“dector”: set position at(0,0) fron “player”
On loop “gravity”
Grav of “player” > 0
“player”: set Y position to Y (“player”)-1
“dector”: set position at(0,0) fron “player”
On loop “gravity”
“player” is overlapping backdrop
Grav of “player” < 0
Stop loop “gravity”
“player”: Set Grav to 0
“player”: Set y position to Y(“player”)+1
“dector”: Set position at (0,0) from “player”
On loop “gravity”
“player” is overlapping backdrop
Grav of “player” > 0
Stop loop “gravity”
“player”: Set Grav to 0
“player”: Set y position to Y(“player”)-1
“dector”: Set position at (0,0) from “player”
yeah. i've never used david newtons tutorial. but that is usually the first place to look.
placing code in the right place sometimes makes all the difference.
try using detectors on the sides of the character that when overlapping a wall backdrop slow down the gravity and reset the jump.
Should I really need detectors on the sides? The bottom detector is the same size as the sprite at the moment; it should reach the wall at the same time as the rest of the sprite.
the bottom detector is for platform detection i assume and there might be something conflicting in the code that won't allow you to do the wall jump stuff. also the detector may not be actually overlapping conistantly. like if its used to detect walls so it pushes the movement away from a wall, it wont 'always' be overlapping. making the wall jump not work at all or not work properly. thats what an extra detector thats on the sides and a bit of ways away from the character would come in handy.
But left and right detectors would be a good idea because you wouldn't need the "pos y > 0" event.
Put the detectors in, and do it so that:
- if 'detector-right' is overlapping bg : cut gravity by 2/3
- if 'detector-left' is overlapping bg : cut gravity by 2/3
The advantage of using this is that because you've used two different detectors for left and right, the wall jumps can be made better too, for example:
- if 'detector-left' is overlapping bg + user presses key : Do a jump + set x acceleration to a positive value
- if 'detector-right' is overlapping bg + user presses key : Do a jump + set x acceleration to a negative value
When I say x acceleration, I just mean make the player go in the x value in whichever method you are using to move left and right. This would give the effect of jumping away from the wall, rather than straight up it, which is unrealistic.
Wow thank you for all the feed back. I understand why side dectors are needed now. So I added this line just to test the wall slide effect
"LDetector" is overlapping a backdrop
"player": Set Grav to -3
Could be because you've already set the gravity value in earlier events. Try adding a condition to the earlier gravity event, for instance "if 'LDetector' is not overlapping a backdrop".