Platformy - 26/09/12

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Platformy - 26/09/12

Post 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 294 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
Attachments
Platformy_3912.love
After images, wall jumping, layers, stuff
(324.92 KiB) Downloaded 223 times
Platformy.love
Original File
(56.28 KiB) Downloaded 224 times
Last edited by Lafolie on Wed Sep 26, 2012 12:16 am, edited 9 times in total.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
Nsmurf
Party member
Posts: 191
Joined: Fri Jul 27, 2012 1:58 am
Location: West coast.

Re: Platformy (Demo)

Post by Nsmurf »

Nice!

I like it. :awesome:
OBEY!!!
My Blog
UE0gbWUgd2l0aCB0aGUgd29yZCAnSE1TRycgYXMgdGhlIHN1YmplY3Q=
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Platformy (Demo)

Post 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.
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Platformy (Demo)

Post 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.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Platformy - A platformer engine.

Post 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.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Platformy - A platformer engine.

Post 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...
Attachments
shot.png
shot.png (209.67 KiB) Viewed 4460 times
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Platformy - A platformer engine.

Post by Lafolie »

Thanks for the report, it has been fixed.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Platformy - A platformer engine.

Post 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
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Platformy - A platformer engine.

Post 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
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Platformy - A platformer engine.

Post 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.
When I write def I mean function.
Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests