The Daily Click ::. Forums ::. Klik Coding Help ::. Please point me in the right direction - platform movement
 

Post Reply  Post Oekaki 
 

Posted By Message

Jess Bowers

Cake > Pie

Registered
  09/01/2009
Points
  310

Has Donated, Thank You!GOTM FEB - 2010 - WINNER!GOTW Winner!
9th January, 2009 at 22:35:15 -

Hi guys! This is my first day on the site and my first post. I've done some poking around and have a question to ask (which) I'm sure has been asked 10,000 times before. Please forgive me.

Around 2002 or so I bought and played around with both TGF and MMF. I created a small platform game for myself and enjoyed hacking away with it. This past Christmas, I treated myself to a purchase of TGF 2 and have enjoyed revisting my old game.

Here's my problem: I've noticed issues with the platform movement (no surprise to you guys). I found this site and did some reading (e.g. reviewed games that get low marks for using the builtin platform movement). I tried to download some of the samples on "custom platform movement" but many of the links were dead.

My question: Can someone point me in the right direction to either a written tutorial or a source sample that I might take a look at. Some of the GOTWs (I played and really liked Elf) must use a custom movement but I don't know if anyone is willing to share their source with me. If you'd like I can post a link to the game I'm trying to make. It's VERY basic by your standards but I'd like to have things like moving platforms, etc.

Any help would be greatly appreciated.
Jess Bowers

 

-MacAdaM-

Megaman Fosho

Registered
  12/02/2008
Points
  560
9th January, 2009 at 22:46:11 -

Here is a Custom Platform Movement that I made a while ago, It's far from perfect, but it is still pretty solid, and can get the job done!
http://create-games.com/download.asp?id=7260


(I don't know if this works with TGF2 )
You can always try something called the PMO, It pretty much can create a easy, solid custom movement.
Hopefully I helped a little bit!
If you need anything else feel free to message me with a question, or I am sure someone else can help you!
This is a really helpful community.


 
Your just jealous that you're not as awesome as me.
(And my megaman avatar )

Deleted User
9th January, 2009 at 23:19:10 -

Most Custom movements I've seen usually start with something simple like

--Left repeat while pressed
---Set player X to player X-1
---Set player animation to Walking
--Right repeat while pressed
---Set player X to player X+1
---Set player animation to Walking
X-Left repeat while pressed
X-Right repeat while pressed
---Set player animation to Stopped

Or, create an square the size of your player and set it to bouncing ball movement
Create a few events that go like this

--Start of Frame
---Set box visiblity to invisible
--Always
---Set X of player to X of box
---Set Y of player to Y of box
--Left Repeat while pressed
---Set direction of box to left
---Set speed of box to 10
---Set player animation to Walking
--Right Repeat while pressed
---Set direction of box to right
---Set speed of box to 10
---Set player animation to Walking
X-Left Repeat while pressed
X-Right Repeat while pressed
---Set speed of box to 0
---Set player animation to Stopped

There are also other things to take into consideration, such as collision detection, which is where the bouncing ball style is alot easier to use, in my opinion.

Create an active object

-When box collides with "wall object"
---Bounce Box

Then go back to your movement code and add another condition to each
X-Player is overlaping "wall object"

And that takes care of the left and right walls The last thing is the ground. Create your ground as a backdrop, and set it to obsticle. Then do this:

X-When box is overlaping obstacle
---Set box Y to box Y+2

There is one more tip for this part. Draw your entire background, each platfrom and everything goes into one image. Then clone it as an active object. Edit the active object and shave of the top two pixels of every platform. If you did a larger or smaller number in the last one, then shave of that many pixels instead. Then as you did with the box, at the start of the frame, make that object invisible.

I'll have more for you in a bit, but get back to me and see if you got it to work or have any questions.

EDIT: And the best advice I can give is to try figuring it out for yourself as much as you can, play around a bit. If you don't get it, do a search on this code-it forum, the programers union and the articles section. If you can't find what you're looking for then, you're more than welcome to come and ask us.

Edited by an Administrator

 

Deleted User
9th January, 2009 at 23:33:04 -

Now, as far as jumping is concerned, all you need is this

--When Shift is pressed
--Box is overlaping background
---Set alterable Value A to 25

--If alterable value A is greater that 0
---Set box y to box y-2
---subtract 1 from alterable value A

--If alterable value A is greater that 0
--Collision between box and "Wall Object"
---Set alterable value A to 0

And the last thing you need to do is on the box is not overlaping backdrop add
--Alterable value of A is less than or equal to 0

I'm going to go back and annotate the code and explain what each one does.

 

Jess Bowers

Cake > Pie

Registered
  09/01/2009
Points
  310

Has Donated, Thank You!GOTM FEB - 2010 - WINNER!GOTW Winner!
10th January, 2009 at 00:03:59 -

First, thank you both (MacAdaM and jneumann1) for responding so quickly. I fed my daughters dinner and when I come back... answers to my questions! Seriously, big thanks.

1. MacAdam - I downloaded your Custom Platform Movement demo and think it's great! Unfortunately, I've had some trouble loading the GAM file. Using these products (all purchased and non-demo), here are the errors I got:
A. TGF 2 (build R248 ) - "Cannot find extension KCfloop.mfx."
B. TGF 1 (build 38 )(32 bit) - "Cannot find gffloop.GOX!"
C. MMF 1.5 (build 118 ) - "Cannot find extension KCfloop.cox."
I would LOVE to take a peek at the code in the demo. Any idea what I might be doing wrong? Do I need an extension that I don't have? If so, is the extension an MMF 2 version only? Again, your demo looks great. Does it have any code for moving platforms (which will carry the player with them horizontally)?

2. jneumann1 - Thanks a ton for the explanation. Its good to have an explanation of the code. I haven't dived into your full explanation yet but will after I get my girls put to bed tonight. As a novice, I'm sure I'll have a question or two.

Thanks again!

Edited by Jess Bowers

 

Deleted User
10th January, 2009 at 00:08:45 -

--Left repeat while pressed
---Set player X to player X-1
---Set player animation to Walking
--Right repeat while pressed
---Set player X to player X+1
---Set player animation to Walking
X-Left repeat while pressed
X-Right repeat while pressed
---Set player animation to Stopped

What these commands do is first takes the conditions when a player hits whichever keys, it moves the player by calculating his current postion, then adding or subtracting one. The last one makes it so if the player does not hit anything, then it stops the animation that's playing.

--Start of Frame
---Set box visiblity to invisible
Tells the game at the start to hide the box

--Always
---Set X of player to X of box
---Set Y of player to Y of box
Always sets the player sprite to the box. Remember, put the player on the box, not the box on the player, or you won't move. The player sprite is just the graphical representation, the box is the one that actually moves and determines collsions.

--Left Repeat while pressed
---Set direction of box to left
---Set speed of box to 10
---Set player animation to Walking
--Right Repeat while pressed
---Set direction of box to right
---Set speed of box to 10
---Set player animation to Walking
These are virtually the same as the XY calculations from the top, but using the builtins to your advantage, you can do much quicker calculations, especially if the player is going somewhere other than left and right.

X-Left Repeat while pressed
X-Right Repeat while pressed
---Set speed of box to 0
---Set player animation to Stopped
This one is more important than the top one for the bouncing ball engine, because not only does it stops the animation, but it stops the player from moving as well.

-When box collides with "wall object"
---Bounce Box
This is another good thing to using the bouncing ball engine, it can bounce, which to the untrained eye, just makes it seem like the player just can't move through it.

Then go back to your movement code and add another condition to each
X-Player is overlaping "wall object"
And this ensures that you definatly cannot move through the force field you've created

X-When box is overlaping obstacle
---Set box Y to box Y+2 <--
This makes it so that when the player isn't touching the ground, which if you've done it right should be peaking at least the ammount of pixels that I'm pointing to, the player will fall down untill it hits the background.

--When Shift is pressed
--Box is overlaping background
---Set alterable Value A to 25

This command only happens if the player presses the jump key and is touching the ground. Then it sets an ammount to an alterable value that is ultimatly the ammount of time that the player hangs in the air.

--If alterable value A is greater that 0
---Set box y to box y-2
---subtract 1 from alterable value A
And then this command which is triggered as soon as the alterable value goes over 0 causes the player to move upwards, and at the same time takes away from the alterable value, so that the player doesn't keep jumping.

--If alterable value A is greater that 0
--Collision between box and "Wall Object"
---Set alterable value A to 0
This command makes it so if the player hits the bottom of a platform, then the player stops jumping and moves back down

And the last thing you need to do is on the box is not overlaping backdrop add
--Alterable value of A is less than or equal to 0
and this makes it so that the falling script doesn't happen untill the alterable value runs out.


Hope this helps get you started. And feel free to play around with the values a bit. Any number on here you can change to increase the speed of your player, the jump time, or whatever you want to do.

As far as the moving platform is concerned, I'll just type it out without the code and see if you can't figure it out kind of on your own. You need 2 active objects that always set itself to eachother, like you did with the box, and it should be similar to the way the backdrop and wall object is, with one acting as the backdrop, the other acting as the wall object which is the same size minus the fall variable (which I've listed as 2). In the wall condition, If player collides with wall then bounce, add copy both conditions into the same event, right click on it and hit "OR(Logical)", and move that in between the two, and change the "Wall Object" on the section set to the platform's "wall object". Do the same with the falling event, copy both conditions into the same event and put an or statement in between them. Then we have to make the platform move. Make sure you put in that even to set the X and Y of the platform's "wall object" to the platform's "backdrop object". Set the backdrop object to bouncing ball and choose the speed. Place that object to whatever Y you want it to be and figure out the X of which points you want it to move to. Create 2 new events one of the conditions will be if the plaform is less than or equal to the lower X number and the other is greater than equal to the larger X number. Let's say between X of 2 and X of 25. So if the X of the platform is less than or equal to 2, change the direction of the platform to the right, and if the X of the platform is greater or equal to 25, then change the direction of the platform to the left.

Alright, I kind of explained it in detail, but you get the Idea. Now, you can tweak it however you want. If you want the player to be able to Jump through the platform, just get rid of that platforms wall object, and if want to do that for part of the backdrop, edit both the backdrop and the "wall object", cut the part of the wall object and paste it as another backdrop and put it in place, and then just delete the same part in the backdrop, so it just functions as empty space, and when the player hits the backdrop, he'll stop. But to make that work, you'll have to change the condition "box collides with backdrop" and "box collides with platform" to a collision mask, which will be if you select the gameboard icon in the conditions, and go down to collision mask->is obstacle, and then change it to Y of box minus the ammount of pixels from the bottom to the hot spot.

If you are confused on anything, just reply.

 

Deleted User
10th January, 2009 at 00:16:33 -


Originally Posted by Jess Bowers
First, thank you both (MacAdaM and jneumann1) for responding so quickly. I fed my daughters dinner and when I come back... answers to my questions! Seriously, big thanks.

1. MacAdam - I downloaded your Custom Platform Movement demo and think it's great! Unfortunately, I've had some trouble loading the GAM file. Using these products (all purchased and non-demo), here are the errors I got:
A. TGF 2 (build R248 ) - "Cannot find extension KCfloop.mfx."
B. TGF 1 (build 38 )(32 bit) - "Cannot find gffloop.GOX!"
C. MMF 1.5 (build 118 ) - "Cannot find extension KCfloop.cox."
I would LOVE to take a peek at the code in the demo. Any idea what I might be doing wrong? Do I need an extension that I don't have? If so, is the extension an MMF 2 version only? Again, your demo looks great. Does it have any code for moving platforms (which will carry the player with them horizontally)?

2. jneumann1 - Thanks a ton for the explanation. Its good to have an explanation of the code. I haven't dived into your full explanation yet but will after I get my girls put to bed tonight. As a novice, I'm sure I'll have a question or two.

Thanks again!



You're welcome, no doubt mine is fairly basic, his may or may not be better. But it's not loading because you need certain extentions for it to work. Type in those file names into a search engine and they'll lead you to the right place.

I forgot that you might need one more thing for my part of the code, to make the player move on the platforms. Start a new event and set the conditions to "box is overlaping platform". Then have it set the box direction (not the player) to the direction of the platform. Also have it set the speed of the box to the platform.

I also forgot, during your movement code, after you set the direction of the box, set the player direction as well. It's important to not just get lazy and say "always set player direction to the box direction" because then if you set the direction of the box on the platform, then the player would look the same way, and you might not want that.

I'm going to eat some chow, and when I get back, I'll put together an example. If you start working on it tonight, I'll check back and answer any question you have.

 

-MacAdaM-

Megaman Fosho

Registered
  12/02/2008
Points
  560
10th January, 2009 at 00:25:37 -

Actually I do know what the problem is.
Making the engine, I used something called Fastloops.
A really handy extension!
Do not worry though, here is a link to where you can download it!
http://www.mediafire.com/download.php?zyjmkzmynyr

I made it using TGF 1 so you should be able to open it.
Just extract that file into were the other extensions are in the TGF 1 folder.

Once your done, you can view the source.




 
Your just jealous that you're not as awesome as me.
(And my megaman avatar )

Deleted User
10th January, 2009 at 00:28:25 -

I just realized that I can't give you the example, simply because I have MMF2, and not TGF2. I'll see about downloading the demo and doing it from there.

 

Jess Bowers

Cake > Pie

Registered
  09/01/2009
Points
  310

Has Donated, Thank You!GOTM FEB - 2010 - WINNER!GOTW Winner!
10th January, 2009 at 02:30:45 -


Originally Posted by MacAdaM

I made it using TGF 1 so you should be able to open it.
Just extract that file into were the other extensions are in the TGF 1 folder.



MacAdaM... thanks! I downloaded the extension and was able to open the GAM file in TGF 1. I did some poking at it looks like TGF 2 doesn't support extensions (at least as far as I can tell). Everything in the extensions folder has an MVX for MFX extension ... and just changing the fastloop file extension and placing it in the TGF2\Extensions folder didn't seem to work. Do I need to use MMF 2 (instead of TGF 2) to use the FastLoop extension in *this* generation of click products?


Originally Posted by jneumann1

I just realized that I can't give you the example, simply because I have MMF2, and not TGF2. I'll see about downloading the demo and doing it from there.



Although I have TGF 2, I think I can download the demo for MMF 2. But, if you think you can create a demo of the code your explaining then I would be hugely grateful.

Guys, I can't say enough how much this helps. I am going to spend some time now trying to build some code in TGF2 (using jneumann1's explanations) and start analyzing the MacAdaM's demo. Sounds like they might be different methods - but both look like they will work great. If I can get the smooth movement, not get stuck in walls, use platforms, etc... I'm going to be extremely happy.



Edited by Jess Bowers

 

Deleted User
10th January, 2009 at 02:39:35 -

I got the demo of TGF2 and I'm putting my code it. There were a few things that I left out, but I'll post the file once it's done.

You're very welcome, and thank you. This is giving me a good practice going back over and improving some old coding practices.

 

-MacAdaM-

Megaman Fosho

Registered
  12/02/2008
Points
  560
10th January, 2009 at 02:50:06 -

Well TGF2 and MMF2 have Fastloops built in.
It was just TGF1 that did not.
So if you need a good custom movement for TGF2, I will try and download the demo and cook something up real fast.

But you could always look at my events and try to reproduce them im TGF2 using the build in fastloops instead of TGF1.

Good luck though.

 
Your just jealous that you're not as awesome as me.
(And my megaman avatar )

Deleted User
10th January, 2009 at 04:20:28 -

http://www.megaupload.com/?d=599UWS7T

Give that a try. It's not as good as what I wrote, and there's even a few different things. I tried to do a platform that moves up and down as well, but it didn't work to well. MacAdaM might be able to come up with something a little better.

 

aphant



Registered
  18/05/2008
Points
  1242
10th January, 2009 at 06:22:05 -

Here's a well-written tutorial, with examples, by David Newton: http://clicktutorial.byethost9.com/zips/plattutorial.zip

It's designed for MMF2, but it uses fast loops so all the basic concepts should work in TGF2.

 

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
10th January, 2009 at 06:58:31 -

Once again, my favourite tutorial has come into discussion

Just thought I'd say that David N's movement is very sufficient for platform games.

 
n/a ...

Jess Bowers

Cake > Pie

Registered
  09/01/2009
Points
  310

Has Donated, Thank You!GOTM FEB - 2010 - WINNER!GOTW Winner!
10th January, 2009 at 07:40:39 -


Originally Posted by Adam Phant
Here's a well-written tutorial, with examples, by David Newton: http://clicktutorial.byethost9.com/zips/plattutorial.zip

It's designed for MMF2, but it uses fast loops so all the basic concepts should work in TGF2.



Hi Adam. I tried the link but it doesn't look like the file is there. Is there a copy somewhere else? Or, do you still have it that you might be able to send to me? Thanks!

 

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
10th January, 2009 at 08:13:30 -

http://www.clickteam.com/eng/resources/fastloop_plattutorial.zip . . .

 
n/a ...

Jess Bowers

Cake > Pie

Registered
  09/01/2009
Points
  310

Has Donated, Thank You!GOTM FEB - 2010 - WINNER!GOTW Winner!
10th January, 2009 at 16:44:32 -

Wow! Guys... I really have to say that I am overwhelmed by your generosity. I honestly had no idea the community would be this supportive. Thanks to all of you: MacAdaM, jneumann1, Adam Phant, and Julian. With the two samples (MacAdaM and jneumann1) and the David Newton's tutorial I think I have everything I need to start changing my game's platform engine from the builtin TGF2 platform movement.

Just to let you know, I've been playing these platform games for a long time and have always wanted to make my own. I think it all started when I was in high school in 1985 playing T h e x d e r on my Tandy. My goal, however, is to make something along the lines of a Halloween Harry-type game (a shooter with 16x16 tiles). I'm sure this will turn out much more basic than what you guys are used to but my goal is to have fun with it. The two parts of building the game I enjoy most: (1) creating the animated sprites (I already have the main sprite and a number of backgrounds) and (2) placing the tiles to build the levels (it's like Lego blocks!)

By the end of the week, I'll respond to this forum post with a link to what I'm working on. Since you've all been so generous with the tips, I think it is only fair that I show you what I'm trying to build. Again, it's more for the fun than anything -- so I can assure you this will be no GOTW.

Thanks again and take care!
Jess Bowers
Atlanta, GA

Edited by Jess Bowers

 

Marko

I like you You like you

Registered
  08/05/2008
Points
  2804

Has Donated, Thank You!Game of the Week WinnerVIP Member360 OwnerDos Rules!Happy FellahCrazy EvilI am an April FoolGingerbread House
10th January, 2009 at 18:45:02 -

I've never attempted a serious platform game before, especially one without using the built in platform movements, but i must say there are alot of cool people who responded to readily to this site!

 
Image

Subliminal Dreams. . ., daily gaming news and the home of Mooneyman Studios!
www.mooneyman-studios.webs.com

Jess Bowers

Cake > Pie

Registered
  09/01/2009
Points
  310

Has Donated, Thank You!GOTM FEB - 2010 - WINNER!GOTW Winner!
13th January, 2009 at 19:32:49 -

Hey guys!

I started building my game's platform engine using David Newton's insanely good tutorial. When I make it a little farther, I'd like to incorporate some of the other ideas expressed and presented here (namely MacAdaM's pole-grabbing movement). At the moment, though, I am a bit stuck on how to incorporate "Moving Vertical Platforms" into this current engine.

I emailed David Newton and he gave me the answer:

http://theclickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=97723

The problem? I'm too dull to implement it properly and can't seem to get it to work. (even though the answer is right in front of my face)

Soooo... I was wondering if someone might be able to take a quick check at my MFA file and tell me what I've done wrong. Again, any help would be greatly appreciated. Here is the file:

http://www.jessandmichelle.com/files/Platform.mfa

I'm trying to get the vertical platform movement as smooth as the horizontal platform movement.

Thanks!!
Jess


 

aphant



Registered
  18/05/2008
Points
  1242
15th January, 2009 at 12:48:33 -

http://www.pfordee.com/psychophan7/alpha_zero/Platform_better.mfa

I removed the bouncing by setting the player Y to the platform's Y. I fixed the resulting falling through when going up by making the detector thicker. Also, I set the player's grav to the platform's vert.

The end result is something smoother that what you had before, though it's not as smooth as it could be.

 

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
15th January, 2009 at 13:46:21 -

Platform Movement Object is in the bonus packs (the TGF and MMF patches and updates) so that should work I would imagine. I think TGF2 just doesn't support 3rd party extensions, those unsupported by CT.


Anyway, my trick is usually to test if he's standing on the platform, and if he is, move him at the same speed and direction as the platform.

So ideally, the platform itself should move at, say, 1px per frame. So when the player is standing on it, we add 1px to his Y speed.

Voila!


It fits neatly with my Dines-Approved way of doing platform movements, which goes thus:

Check player's environment:
--- Standing on floor?
--- Has obstacle above?
--- Has obstacle left?
--- Has obstacle right?
--- Is standing on moving platform?

Apply his movement:
--- Gravity: Either add gravity or cancel it depending on whether he's on the floor or not
--- Controls: If a button has been pressed, like LEFT/RIGHT, JUMP, whatever, add or reduce his speed accordingly.
--- Platforms: If he was standing on a moving platform, add the platform's X and Y speed to his own.

Perform his movement:
--- Actually move him, with collision detection and stuff


This way, the player is just kind of inheriting the platform's inertia!

 
191 / 9999 * 7 + 191 * 7

Jess Bowers

Cake > Pie

Registered
  09/01/2009
Points
  310

Has Donated, Thank You!GOTM FEB - 2010 - WINNER!GOTW Winner!
19th January, 2009 at 07:54:13 -


Originally Posted by Adam Phant
I removed the bouncing by setting the player Y to the platform's Y. I fixed the resulting falling through when going up by making the detector thicker. Also, I set the player's grav to the platform's vert.

The end result is something smoother that what you had before, though it's not as smooth as it could be.



Thanks, Adam! I still want the vertical platform movement to be a bit smoother but I really appreciate the help.


Originally Posted by DeadmanDines
Platform Movement Object is in the bonus packs (the TGF and MMF patches and updates) so that should work I would imagine. I think TGF2 just doesn't support 3rd party extensions, those unsupported by CT.



Is the Platform Movement Object (PMO) pretty good? Do you think it's better than the fastloop custom movement? Besides the vertical platforms and ladders, I've been pretty happy with the gameplay of David Newton's engine so far. It's been pretty smooth. However, I'd love to take a closer look at the PMO if you have a sample...


Originally Posted by DeadmanDines
Anyway, my trick is usually to test if he's standing on the platform, and if he is, move him at the same speed and direction as the platform.

So ideally, the platform itself should move at, say, 1px per frame. So when the player is standing on it, we add 1px to his Y speed.

Voila!


It fits neatly with my Dines-Approved way of doing platform movements, which goes thus:

Check player's environment:
--- Standing on floor?
--- Has obstacle above?
--- Has obstacle left?
--- Has obstacle right?
--- Is standing on moving platform?

Apply his movement:
--- Gravity: Either add gravity or cancel it depending on whether he's on the floor or not
--- Controls: If a button has been pressed, like LEFT/RIGHT, JUMP, whatever, add or reduce his speed accordingly.
--- Platforms: If he was standing on a moving platform, add the platform's X and Y speed to his own.

Perform his movement:
--- Actually move him, with collision detection and stuff


This way, the player is just kind of inheriting the platform's inertia!



That sounds like a plan, DeadmanDines! I've been hard at work on this custom platform engine and feel like its come a fair way:

Image

I've also created a project for a game using the future engine:

http://www.create-games.com/project.asp?id=1440

Features in the engine that work so far include:
- Variable Height Jumps
- Double Jumps
- Moving Platforms (Horizontal)
- Conveyors
- Springs

Features in the engine that aren't fully implemented:
- Ladders
- Moving Platforms (Vertical)
- Shooting (which shouldn't be hard)

As for the moving vertical platforms, DeadmanDines, I think I need to implement your recommendations. Hope I don't blow it, though!

On the topic of ladders, I'm not the only one struggling to add them to David Newton's engine right now:
http://theclickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=123921#Post123921

I think I'm close, though, but need to make a few decisions about how they will work. Should the player "catch" the ladder when falling or does the player need to press the "UP" key to "catch". I'm not too sure right now -- I guess it is a matter of preference as I've seen both in different games.

NEED HELP!!!:

Also, as I am not a developer I am stuck on something you guys will probably find pretty basic. When the sprite starts climbing a ladder, I can't get the climbing animation to loop! It only plays the first frame of the climbing animation.

Image

Mind you this only a placeholder animation until I get the whole series drawn, but, at least as far as I know, it should be animating. Can anyone take a look at the MFA file and see what's going wrong?

http://jessandmichelle.com/files/plokey/Plokey-Engine.mfa

Thanks!
Jess

 

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
19th January, 2009 at 10:21:29 -

I used the same platform engine to make a quick platform game once, and also found that verticle platforms aren't in the tutorial. I did e-mail David however and he showed me that it's really quite simple! I'll check my old mfa to see if I can remember how I did it

Well I'll upload the game, you should play around with it a bit and see how I made the verticle moving platforms work. I forgot to get rid of the 'perspective object' before I uploaded it but if you get an error when opening the file that says something like "Perspective object could not be found" just ignore it because the object isn't vital to the game

Here it is:

http://sites.google.com/site/julianmsmithies/Home/JailBreak.mfa?attredirects=0

 
n/a ...

Jess Bowers

Cake > Pie

Registered
  09/01/2009
Points
  310

Has Donated, Thank You!GOTM FEB - 2010 - WINNER!GOTW Winner!
19th January, 2009 at 15:41:25 -


Originally Posted by -Julian-
Well I'll upload the game, you should play around with it a bit and see how I made the verticle moving platforms work. I forgot to get rid of the 'perspective object' before I uploaded it but if you get an error when opening the file that says something like "Perspective object could not be found" just ignore it because the object isn't vital to the game



Julian, thanks for making your game file available! Unfortunately, I can't open it - due to the error mentioned - and TGF2 doesn't allow me to just ignore it. Is there a way you could remove it and repost it? If not, perhaps I could use the MMF2 demo to open and remove it (though, I'm not sure).

Thanks!

 

Jess Bowers

Cake > Pie

Registered
  09/01/2009
Points
  310

Has Donated, Thank You!GOTM FEB - 2010 - WINNER!GOTW Winner!
19th January, 2009 at 21:55:40 -


Originally Posted by Jess Bowers
Julian, thanks for making your game file available! Unfortunately, I can't open it - due to the error mentioned - and TGF2 doesn't allow me to just ignore it. Is there a way you could remove it and repost it? If not, perhaps I could use the MMF2 demo to open and remove it (though, I'm not sure).



Hey, Julian. I was able to open the file and am now looking at it. I downloaded the extension (
http://ext.neatwares.ath.cx/search/perspective/) and used the MMF2 demo. I think I should be able to import the MFA file into TGF2 once I remove the extension references.

Edited by Jess Bowers

 

Jess Bowers

Cake > Pie

Registered
  09/01/2009
Points
  310

Has Donated, Thank You!GOTM FEB - 2010 - WINNER!GOTW Winner!
21st January, 2009 at 16:56:53 -

I think I'm getting close! I eliminated the "bounce and shake" by using Julian's example. I'm still having some problems getting it right so I probably need to take a closer look at the example. The problems I am having right now are as follows:

1. When the platform moves DOWN - the sprite appears about 1 pixel above the platform
2. When the platform moves UP - the sprite appears about 1 pixel below the platform

Image

Also, I normally set the platform "detector" to a 1-pixel width (as recommended in David Newton's tutorial). Unfortunately, with the problems I am having above I can't seem to pinpoint the platform detector with my sprite's detector -- hence allowing the sprite to jump. So, at least for the moment, I have the platform detector set to 32x16 (rather than 32x1). This was done by changing the platform's direction from 0 to 16 (which has a different graphic).

Once I get the sprite's location fixed, I think I can move the platform detector back to the 1 pixel width.

Any ideas? The MFA file is here:

http://jessandmichelle.com/files/plokey/Plokey-Engine.mfa


 

aphant



Registered
  18/05/2008
Points
  1242
21st January, 2009 at 17:50:57 -

The only thing I can think of is separating the events. Make one for going up, one for going down.

 

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
22nd January, 2009 at 02:12:03 -

I can tell you what the problem is with the lift, but I'm not entirely sure how to fix it. As you probably know by know MMF code executes from top to bottom in a list fashion.

What is happening first is that the player is that the player is being positioned on the vertical platform, however in the last group the platform itself is moved. Thus when the frame draws the platform will have moved a tiny bit in reference to the player.

In effect it's doing this:
* Check if player is overlapping platform:
If so, put player on top of platform
* Move platform

When you want this:
* Move platform
* Check if player is overlapping platform:
If so, put player on top of platform

If you simply take the group "Moving Platforms" and place it above the group "Gravity/Jump" you can see how it changes the engine's behaviour. I'm not sure how to fix it because I haven't looked at the engine long enough, but it's to do with the order of events and perhaps you need to combine the gravity code with the moving platform code.

If you cut the lines of code under "Gravity/Jump" from "If the current gravity is not equal to zero, start the gravity loop equal to the number of times the current gravity value." to the blank green comment and paste them at the very end of your code you will see that the player stays on the platform, at the expense of glitching up other parts of the engine.


In terms of the ladder animations, I managed to fix them:
http://www.mediafire.com/download.php?nndy2dykkjj

The problem was that there was conflicting code in the last lines of the "Animation" group. For the lines under the comment "When no button is pressed and the player is moving left, stop movement." I simply added "Climbing of Player = 0" to all the conditions. In a similar manner to the problem before, you were telling the player to set its animation to "stopped" and then a few lines later in the "Ladders/Climbing" group, you were telling the player to change his animation to climbing. The conditions I added check if the player is climbing, and will only change his animation when he is not.

I also added lines of code under "Ladders/Climbing" which are commented in red. These stop the animation from looping while you are stationary on the ladder, and play the animation while you are moving. I don't think it's the exact effect you wanted because you stated that you want a smooth engine. I think you will need to tweak the engine to make the character actually "snap" to the rails. But this is a start.

Good luck and keep us posted.

Edited by an Administrator

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Jess Bowers

Cake > Pie

Registered
  09/01/2009
Points
  310

Has Donated, Thank You!GOTM FEB - 2010 - WINNER!GOTW Winner!
22nd January, 2009 at 05:19:34 -


Originally Posted by Assault Andy
I can tell you what the problem is with the lift, but I'm not entirely sure how to fix it. As you probably know by know MMF code executes from top to bottom in a list fashion.

What is happening first is ... (insert excellent explanation)



Aaaaaahhh! That makes complete sense, Andy. Thanks for the great explanation! I don't know how to how to fix that either, but I'm going to keep tinkering until I find a way. I really want the engine to be as smooth as silk and am sure there is some way to make it work.


Originally Posted by Assault Andy
In terms of the ladder animations, I managed to fix them:
http://www.mediafire.com/download.php?nndy2dykkjj

The problem was that there was conflicting code in the last lines of the "Animation" group. For the lines under the comment "When no button is pressed and the player is moving left, stop movement." I simply added "Climbing of Player = 0" to all the conditions. In a similar manner to the problem before, you were telling the player to set its animation to "stopped" and then a few lines later in the "Ladders/Climbing" group, you were telling the player to change his animation to climbing. The conditions I added check if the player is climbing, and will only change his animation when he is not.



THANKS!!! I am more of an aging gamer with dreams of being a pixel artist than a programmer. I really appreicate your help on this! I posted your edited version up to my site so that anyone downloading it will get your revised version. Developing this game (once the engine is finished), will become much more fun for me as I get to create all of the cool and interesting enemies and traps for the player to evade.


Originally Posted by Assault Andy
I also added lines of code under "Ladders/Climbing" which are commented in red. These stop the animation from looping while you are stationary on the ladder, and play the animation while you are moving. I don't think it's the exact effect you wanted because you stated that you want a smooth engine. I think you will need to tweak the engine to make the character actually "snap" to the rails. But this is a start.



Again, I really appreciate you taking the time to look at this! You're right-- I do want the character to "snap" to the ladder rails. I've seen a few ways that ladders were implemented and need to play around with that ladder code to get that "perfect feel" to them. My current thinking (which may change) is that the character should stick to the ladder when jumping - but only on the DOWN part of the jump. This would allow the player to essentially JUMP on the ladder and then STICK the character only when they started to FALL (rather than have the character fall all the way to the ground which is what happens now). Also, the "snap" should lock the player to the center of the ladder. I think that can happen with a reset of the players X coordinate when they start climbing (not sure how yet, though). I will probably work on the climbing animation before I work on that code.


Originally Posted by Assault Andy
Good luck and keep us posted.



Absolutely! You guys have all been extremely cool and helpful. I just hope that the final product is (1) fun to play, and (2) someone likes the final graphics enough to "leverage" a few pieces. Either way, I'm having a lot of fun with this project.

 

Jess Bowers

Cake > Pie

Registered
  09/01/2009
Points
  310

Has Donated, Thank You!GOTM FEB - 2010 - WINNER!GOTW Winner!
25th January, 2009 at 03:39:27 -

Okay, so I've been tinkering away as hard as my feeble mind permits. My toiling has produced a "workable" (although not likable) solution. I can get the character onto a moving vertical platform and (1) keep him there without falling through, and (2) have him perform the "walking animation" when moving right and left.

Image

There are still a few problems related to the Moving Vertical Platforms:

1. The character bounces between 1 to 2 pixels below the platform's top edge. I'm not sure what is causing the bouncing.
2. I had to increase the size of the platform detector from a 1 pixel width to 5 pixels (otherwise, he would fall through the detector). I'm not sure why I had to do this. What this does mean is that the character is able to jump from below the platform and land on it (even though the zenith of the jump was only midway through the center of the platform).
3. I can't get more than one vertical platform on the level. With the horizontal platform code, I can put multiple horizontal platforms in the same level with no problem. With the code that I have right now, multiple vertical moving platforms get all screwed up.

Also, I have a problem with the ladders:

1. If the character jumps off of or leaves a ladder midway through the climb, the "climbing" animation does not turn off. The character then runs around the screen looking like a stumpy troll. I'm not sure why the normal animation is not turning back on.

Any help would be greatly appreciated! Thanks.

Latest MFA file:

http://jessandmichelle.com/files/plokey/Plokey-Engine-v2.mfa

Edited by Jess Bowers

 
   

Post Reply



 



Advertisement

Worth A Click