PDA

View Full Version : Very basic platform game with a single level, not a question, comments welcome



robert83
23-08-2011, 09:07 PM
Hello Everyone,

After a few days of playing with stuff, studying Traveler's awesome tutorial, and some other bouncing ball delphi tutorials... trying to make it even more simple, I think I did something good here :) (and feel proud of it... though not much of a thing I know :) ...)

Currently I've managed to create a little platform game skeleton with a single level, that
has working collision, gravity and jumping. The special thing is, I'm handling gravity and jumping entirely inside the Hero Sprite's onMOVE procedure, the "camera" that is following the hero is handled here as well.

Right now it has a small "bug" that I don't like, if the player jumps and hits the wall with hero's upper part the falling down abnormal...

Plus : sometimes I get stuck in the wall..damn (rarely... have to somehow put the player right beside it correctly...)

I'm attaching the entire source code as well as the executable, please try it and comment.

Next thing I plan to do is, Ladders, those CLOUD things, where you can enter the object from any direction but it's upper part... and Pogo stick jump (already did this by mistake :) , planing to implement it correctly by pressing the space a bit longer), double jump maybe...

A bit of warning if you change the level.txt, make sure that the edge lines are kept there, otherwise the character will fall out to infinity , and nothing is there to prevent it from happening.

Also I will really use CONST's next time...

572

Controls : Left and Right arrow key, SPACE is used to jump

Greetings
Rob

paul_nicholls
26-08-2011, 03:56 AM
Looking pretty good so far :)

Keep up the good work!

cheers,
Paul

WILL
27-08-2011, 02:55 PM
Hi Robert, why not post some screenshots to show off what your game looks like. :)

Including screenshots and even video of your projects actually increases visibility and as a result interest in projects posted on PGD. Something I noticed years back. Plus it gives more for people to provide feedback on, especially if their default platform is not the one you are developing for. It is a multi-platform industry more than ever now. (For example I'm on a Mac right now.)

I like Traveler's platformer tutorial myself. I took a lot of ideas from the tutorial you speak of an incorporated them into my own platform game engine I started a few years back. If you are interested, you can probably find a link to the source code here on PGD. Just do a search for Cyber-Crisis and it should come up. I believe I named the file c-c_source.zip or something to that effect. If you do find it, or want it (I can send it via email) I've given it away since the project was canceled so I don't mind if you use it or take pieces from it for your own game projects. I'd change up the artwork for anything final that you do though.


Also did you mean to show off your project rather than ask about Andorra 2D, because I don't see much about your post that relates to Andorra 2D. We should all make our best effort to keep the forums organized and on topic in the right forum topics. So let me know and I'll move your post to the right forum. Thanks.

robert83
28-08-2011, 02:36 PM
Hello,

WILL : it's about Andorra 2d , I wanted to show what I did, and maybe I incorrectly formulated it... I really wanted feedback if I'm doing something wrong, or if there are better ways to do it in Andorra 2d.


Greetings
Robert

code_glitch
28-08-2011, 09:52 PM
Looks nice, works like a charm on Ubuntu 10.10 x64 with wine 1.3.26 and am I correct in saying the points on the person are for collision detection? Shiny.

Chesso
11-10-2011, 08:58 PM
Nice work, much better result than I have managed in the past with collisions.

With your grassy/ground textures I noticed when jumping (not walking off edge and falling) that you have the same issues I once had, where you actually see the bottom of the sprite fall below the top edge of the ground and quickly get pushed back up. I think I actually ended up fixing that, but it was so long ago I can't remember.

SilverWarior
06-12-2011, 06:34 PM
Robert after looking trough your code I belive I found solution for your bug.

To get rid of your bug you need to manualy set the height of your figure after detecting colision with the celing so that the figure would be just below the celing. This would prevent colision with your figure and wall in the nex pas as it's happeneing now becouse the figure's head literaly gets into the celing. It seems that the same bug happens when detecting colision with ground.

Also for specifying direction of movment don't use strings like 'up'. Why? String comparison is quite slow. While now it doesn't affect much the overal speed of your game but if you intend to have some enemies in future wich would also obey the same physics that your character does it will be quite noticable.
So instead of using strings for specifying direction off movments use colection off available directions like:

type
TDirection = (dirUp, dirDown, dirLeft, dirRight)