Platformer game engine (a proper one, really!)

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
timmeh42
Citizen
Posts: 90
Joined: Wed Mar 07, 2012 7:32 pm
Location: Cape Town, South Africa

Re: Platformer game engine (a proper one, really!)

Post by timmeh42 »

EDIT: I just realised that the game is performing in a highly suspect way on my pc - worse than these "glitches" show. Does this require love 0.8.0?
Otherwise, something is causing havoc with how it runs for me. Anyway, these are the supposed glitches I found:


Glitch Time:
Found a bug where you can get stuck in a normal block (not the moving ones). Seems to be something along the lines of:

1: Stand in the one-space-wide gap between two blocks. Move left until you cannot move any further. Now move right. Teleports into the block.
2: Holding 'jump' and 'right' as you fall towards the top-left corner/side of a block. You then get teleported into the block.
3: Jumping up on the left side of a block, then pressing right. Again, teleported into the block.
4: On the 'jumping' level, pressing 'right' immediately after spawning teleported me into the block on the right.

All of these were sometimes not replicable for unknown reasons. Maybe need the x position to be a multiple of something?

A few screenshots of the glitch:
Image
Image
(Couldn't seem to replicate that one after a while - dunno why.)
Last edited by timmeh42 on Tue Mar 13, 2012 3:08 pm, edited 1 time in total.
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Platformer game engine (a proper one, really!)

Post by coffee »

lava.png
Some problems may happen when jumping to movable platforms. As you see in screenshot player got stuck once in Lava. Also and hard to reproduce again the player but not the game (since lava animation was still running) got frozen once in an upper regular platform in Up and Down.
User avatar
timmeh42
Citizen
Posts: 90
Joined: Wed Mar 07, 2012 7:32 pm
Location: Cape Town, South Africa

Re: Platformer game engine (a proper one, really!)

Post by timmeh42 »

Possibly the same as what I am experiencing, seems to be with moving/shifting platforms too, then.
User avatar
YellowAfterlife
Prole
Posts: 29
Joined: Mon Jan 23, 2012 4:05 pm
Contact:

Re: Platformer game engine (a proper one, really!)

Post by YellowAfterlife »

Updated game with a small bug-fix for mentioned thing. Or, at least I think it is a fix. I can't reproduce this error no matter how hard I try, both in 0.8 and 0.7.2
Judging from provided descriptions, issue happens in player's update event when trying to move right and\or downwards.
Apparently error is caused by usage of math.ceil(), but I fail to see how could it work differently on different systems or versions.
Also made game restart if player gets stuck in a 'door' block.
Tell me if it works right now.
yal.cc
Contains things I work on. Also gets Love2d examples time to time.
User avatar
timmeh42
Citizen
Posts: 90
Joined: Wed Mar 07, 2012 7:32 pm
Location: Cape Town, South Africa

Re: Platformer game engine (a proper one, really!)

Post by timmeh42 »

Yes, you've fixed it.
To be sure, I tried to glitch into the walls on 1.0.3 as well to compare. Using the same methods, 1.0.3 could get me stuck but 1.0.4 couldn't.

EDIT: Also, I just realised that the reset button and its associated counter are broken - they should activate once on key press, not continuously while the key is being held down.
User avatar
YellowAfterlife
Prole
Posts: 29
Joined: Mon Jan 23, 2012 4:05 pm
Contact:

Re: Platformer game engine (a proper one, really!)

Post by YellowAfterlife »

Updated ~ 1.0.5
Changes:
* Fixed bug with continuous restart. Also added implementation of system to make checking for key presses\releases easier in object events. See this for separate post on that.
* Changed format of storing objects a bit, to allow level modifications (level.plot, level.add) to be done more intuitively, and for it to be possible to define blocks outside of loadable range (blocks that are only created by code, and not loaded from strings)
* Added a nice-looking player death animation. Also serves as example of re-using code from block behaviour in object behaviour.
* Altered ending screen a bit.

Unless there are more ninja bugs that I don't know about, could consider this as stable - will be making first games upon it around next week.
yal.cc
Contains things I work on. Also gets Love2d examples time to time.
meoiswa
Prole
Posts: 48
Joined: Wed Mar 14, 2012 8:13 pm
Location: Venezuela

Re: Platformer game engine (a proper one, really!)

Post by meoiswa »

The math.ceil() bug could have been provoked by this:
Consider the player's X position, ranging from 0 to 150, and a block's position, which's left side is at 50 and right at 100.
If the player approaches from the left side of the block, that is, augmenting is X, then math.ceil() would effectibly move the player LEFT (because it decreases the X value) when called. If he comes from the right, math.ceil() will also make the player move left, and thus getting stuck in the right side of the block
Write the ö of Löve with Alt+numPad(148) or Alt+numPad(153)
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Platformer game engine (a proper one, really!)

Post by coffee »

Never more got the stuck bug. :)
The small improvements are good quality touches.
Could be a question of taste but I think that jump probably needs some alternatives ways of jumping. The way it does now don't look very natural. It's good if jumping with a jetpack but a person couldn't other way contradict or stop in the air the jump as we does now.
Good work.
User avatar
trubblegum
Party member
Posts: 192
Joined: Wed Feb 22, 2012 10:40 pm

Re: Platformer game engine (a proper one, really!)

Post by trubblegum »

Runs pretty smooth.
How are enemies implemented?
What about menu screens? Is that beyond the scope of the engine?
I presume collision functionality is available to be borrowed for gui implementation regardless.
User avatar
timmeh42
Citizen
Posts: 90
Joined: Wed Mar 07, 2012 7:32 pm
Location: Cape Town, South Africa

Re: Platformer game engine (a proper one, really!)

Post by timmeh42 »

Ah, one last thing - some of the levels have low ceilings, and the player goes off the level when s/he jumps but is still drawn at the top, leading to a sort of sticking-to-the-ceiling effect - I guess it's just a level design thing though.
Post Reply

Who is online

Users browsing this forum: No registered users and 85 guests