The Daily Click ::. Forums ::. Klik Coding Help ::. Hello, oh and....
 

Post Reply  Post Oekaki 
 

Posted By Message

siegeon



Registered
  28/03/2008
Points
  18
28th March, 2008 at 14:57:35 -

Hello,

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”

Thanks!

Siegeon


Siegeon.

 
n/a

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
28th March, 2008 at 15:10:10 -

where is the code you tried to use located? before or after all that jump/gravity code?

 
n/a

siegeon



Registered
  28/03/2008
Points
  18
28th March, 2008 at 15:15:33 -

Oh sorry

I would place it at the end I thought.

 
n/a

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
28th March, 2008 at 15:19:26 -

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.

 
n/a

siegeon



Registered
  28/03/2008
Points
  18
28th March, 2008 at 15:23:34 -

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.

 
n/a

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
28th March, 2008 at 15:30:13 -

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.

 
n/a

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
28th March, 2008 at 15:33:59 -

Image

 
n/a

Steve Hallam



Registered
  02/03/2008
Points
  37
28th March, 2008 at 15:36:09 -

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.

Image Edited by the Author.

 
Eyyyy Macarena!

siegeon



Registered
  28/03/2008
Points
  18
28th March, 2008 at 15:48:45 -

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

However the drop rate stays the same... Thoughts?

 
n/a

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
28th March, 2008 at 15:52:51 -

you mean it works but the slide is consistantly dropping at the same rate? or it doesnt work?

 
n/a

Steve Hallam



Registered
  02/03/2008
Points
  37
28th March, 2008 at 15:53:37 -

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".

 
Eyyyy Macarena!

siegeon



Registered
  28/03/2008
Points
  18
28th March, 2008 at 15:56:22 -

Im not sure how to add the "is not" to the overlaping of the background

Do you negate it?

Ie

X "LDetector" is overlapping a backdrop

Image Edited by the Author.

 
n/a

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
28th March, 2008 at 15:58:02 -

you add it normally "is overlapping" the right click the event and choose "negate"

 
n/a

siegeon



Registered
  28/03/2008
Points
  18
28th March, 2008 at 16:13:55 -

I must be adding it in the wrong place

So now I have two rules to set the effect of gravity.

1. "LDetector" is overlapping a backdrop
Grav of "player" < 10
"player": Set Grav to Grav("player")+0.15

2. "LDetector" is not overlapping a backdrop
Grav of "player" < 10
"player": Set Grav to Grav("player")+0.45

When Pressed up aginst the wall the effects of Grav are the same as when away from wall still.

 
n/a

Steve Hallam



Registered
  02/03/2008
Points
  37
28th March, 2008 at 16:23:19 -

Can't see why that shouldn't work, is the LDetector constantly overlapping the BG when the player is up against the wall?

 
Eyyyy Macarena!
   

Post Reply



 



Advertisement

Worth A Click