Page 1 of 3

Platformy - 26/09/12

Posted: Mon Aug 20, 2012 2:41 am
by Lafolie
Hello people of the forums. I have been working on a platform 'engine' (I don't like to call it that) and I thought I'd share it since it's in a form of "playable" state. Which means that you can run around a simple map.

The newest version features a huge set of changes over the old one. It now uses gamestates, handles resources in an efficient manner and has some stuff tidied up. Along with this I fixed a load of collision bugs and implemented camera snapping. There are myriad changes like animation taking movement speed into account too. I'm still not happy with the 'physics', but I would like to implement other things.

Oh, one thing you might like to know is that Platformy now saves its preferences in the save directory. If you open preferences.txt you can change things like vsync and key bindings.

I started out wanting to make a Metroid clone, because it's pretty simple and has graphics that are easy to work with. Part way into coding this I realised it could easily be made scalable, so I made it that things like tile and sprite sizes aren't fixed and it parses a texture atlas into a spritebatch and whatnot. I was really surprised at how fast it renders the map this way, even if it is quite small.


Image
Image

At the moment there's just a bare map you can run around. Enemy data exists but isn't used yet.

There's also a git repo: https://github.com/Lafolie/Platformy
Platformy26912.love
Code revamp, loads of changes
(432.95 KiB) Downloaded 300 times

[attachment=1]Platformy_3912.love[/attachment]
[attachment=2]Platformy.love[/attachment]


Controls:
  • WASD - Movement
    / (slash) - Fire
    . (dot) - Jump
    F1 - Toggle debug
    F2 - Toggle resolution
    F3 - Toggle fullscreen
    Escape - Quit
And of course, it's for 0.8.0

Re: Platformy (Demo)

Posted: Mon Aug 20, 2012 4:26 pm
by Nsmurf
Nice!

I like it. :awesome:

Re: Platformy (Demo)

Posted: Mon Aug 20, 2012 5:14 pm
by T-Bone
It doesn't feel smooth on my overpowered computer. Are you using vsync or something? EDIT: Yes you are. Consider turning it off, some computers don't like it.

Also, moving right or left while space bar is held down doesn't work, but that might not be your fault.

Re: Platformy (Demo)

Posted: Mon Aug 20, 2012 5:26 pm
by Lafolie
Thanks for taking the time to look at this.
T-Bone wrote:It doesn't feel smooth on my overpowered computer. Are you using vsync or something?
I am. I always use it. I have been disabling it from time to time to check the fps without it, but I neglected to include a toggle for now since 60fps should be fine. If you want to disable it, look for the setMode at around line 70 of game.lua. I left it out because I thought it unnecessary.

I've been tweaking with the values somewhat, and have ironed out a few glitches/bugs present in this one. Right now I'm in the middle of adding non-flat surfaces (ramps) and toying with the map to playtest all manner of collisions.

Stuff (perhaps noticeable) in the above demo that is now fixed:
  • -Can no longer pass through the corners above the player
    -No longer gets stuck in 1x1 block holes in a wall
    -Fixed sprite appearing in ceilings on collision
    -Collisions are proportionate to Entity sizes
    -Vertical collisions are handled better
    -You can run over gaps of 1 block (like Mario)
    -Proper animations when running over said gaps.
I'll post an update soon, with vsync toggle (there goes another function key) and the ramps.

Re: Platformy - A platformer engine.

Posted: Thu Aug 23, 2012 2:12 am
by Lafolie
I posted an updated version of the game that now has working ramp tiles. As simple as they may seem, this took ages to get just right, with some help from bartbes. The overall movement should feel a lot smoother and more accurate now as implementing the stairs led to many holes in the code which were plugged to make everything feel more solid.

Next up is inverted ramps for ceilings, and a small fix for ones placed in the air. Then I'll get scrolling working, a bit of tidying and it will be ready to build a game. Shooting and things. From testing I've found that people seem to enjoy navigating the map, like climbing to the bush at the top, so I think I might make a time/score attack stage using the Metroid sprites.

Any comments are appreciated.

Re: Platformy - A platformer engine.

Posted: Thu Aug 23, 2012 3:24 am
by Roland_Yonaba
Collision works fine for me. Nice job, on this.
Starred on Github!

Well, I ran into a weird behaviour, though. See the attachment, below.
When standing on the block above the initial position, pressing down 'D' key (to move right) makes the player stand stop-start...

Re: Platformy - A platformer engine.

Posted: Thu Aug 23, 2012 2:13 pm
by Lafolie
Thanks for the report, it has been fixed.

Re: Platformy - A platformer engine.

Posted: Thu Aug 23, 2012 3:48 pm
by Roland_Yonaba
Lafolie wrote:Thanks for the report, it has been fixed.
Good to know. Have you attached a new *.love ? Seems not.
And question, what are the blue rounded rocks are ? Should the pkayer be colliding with them ?
Are you planning to add juicy things like ladders, moving platforms, ... ?
And please, do not throw me into this time-rift.

I remember I went through a very interesting lecture one day. It was all about platform games, maybe you could find something useful to you.
See the guide to implementing 2D platformer

Re: Platformy - A platformer engine.

Posted: Thu Aug 23, 2012 5:09 pm
by Lafolie
I didn't update the .love because I dislike to spam the forums with uploads and such, but I've pushed it to the repo. That article is not so useful to me, but have you considered adding it to Free Game Resources?

Ha, I've had a few people show concern about those bushes. They're blue because I just added a tile to sit in the 'background' (no-clip/collide) and I just grabbed the first thing I saw. There's a green one too :P

Re: Platformy - A platformer engine.

Posted: Sat Aug 25, 2012 2:11 pm
by kikito
Lafolie wrote:I didn't update the .love because I dislike to spam the forums with uploads and such, but I've pushed it to the repo. That article is not so useful to me, but have you considered adding it to Free Game Resources?
Donsies.