A quick platformer

Community Forums/Monkey Talk/A quick platformer

therevills(Posted 2011) [#1]


http://www.therevillsgames.com/monkey/platformer/


slenkar(Posted 2011) [#2]
its a bit buggy laddie,
mario gets stuck in the landscape and falls through it


therevills(Posted 2011) [#3]
I saw that once, but couldnt reproduce it... can you? Still WIP :P

Edit:

LOL - just loaded it up and I can repeat all the time now... jump of the highest block to the left...

I changed the gravity to be stronger, so when Mario falls, the check to see if he should stop sometimes miss a block, therefore he falls thru...

Last edited 2011


Dabhand(Posted 2011) [#4]
I like making platformers... I've never made a major platform game, but, slopes make all the difference.

I'd just use usually array checking (Well, I use bit-shifting for the bonus optimization), but, when objects are on screen, I performed pixel checking on tiles that where used as slopes, it was a much simpler way then fannying on with arrays checking.

Now, over the years, when I've discussed the subject, people have harped on that 'bit-shifting is overkill', which the usual reply from myself was "I don't care"! ;)

Then, people whinged that "Well, pixel collision wont work when enemies are off screen", which is fair do's, but, my approach to that is simple... When an enemy is off screen, pause their movements!

This was about the best approach for platformers that I found without going into the realms of mucking about.

I'd love to make another and release it, but a project like that is waaayyyyy above my head in terms of making my own media, so, I'll probably never bother! :D

Dabz

Last edited 2011


therevills(Posted 2011) [#5]
I hate doing slopes!!!

Ive updated the example... hopefully you cant fall through it now... I hope..


Dabhand(Posted 2011) [#6]

I hate doing slopes!!!



Slopes are easy, I'd knock out an in-depth explanation on it, but the last time I remembered someone doing that (Vic-e-babes), the entire tutorial was greeted with as much enthusiasm as Col. Gaddafi at a rebel tea-party!

Dabz


GW(Posted 2011) [#7]
Just tried it, in the HTML version the character gets stuck a lot in the blocks.

You have to make sure that (CurrentPos + Velocity) is always less than the size of a block.


therevills(Posted 2011) [#8]
:(

This is my logic:


if KeyDown(KEY_LEFT)
	direction = LEFT
	Local tempx# = x - xSpeed*dt.delta
	if getCollisionTile(tempx - image.w2 , y) = 0
		x = tempx
	else
		x = (x-image.w2) / TILE_SIZE) * TILE_SIZE + image.w2
	endif
endif



taumel(Posted 2011) [#9]
I really like 2d plattformers but never found the time/project to do one on my own. I already asked this before here on the forum. What is the best way to do all the collision tests with the surrounding? a) checking against a invisible collision bitmap (that's what i would think), b) testing against visible graphics (do you do this on a more tolerant level if a collision occur or just by intersecting rectangles, do you use two layers in the tileset then for collisions and where a character can be covered), c) testig against a level map first and then adjusting things according to the current tile or d) by physics?

I wouldn't mind if someone provides some explanations/thoughts on what's the most flexible and reliable solution from their experience/point of view, as well as some links or source.

Last edited 2011


therevills(Posted 2011) [#10]
In the past, Ive used two layers, one for the tileset set and one for the collisions.

I've added a level editor... of course HTML5 cant save files, but it can output a string and load a text file :P


steve_ancell(Posted 2011) [#11]
slenkar (Posted 1 day ago) #2
its a bit buggy laddie,
mario gets stuck in the landscape and falls through it


therevills (Posted 15 hours ago) #3
I saw that once, but couldnt reproduce it... can you?


I found one thing that triggers that to happen. Make the character jump repeatedly on the spot, it will happen every 3-4 jumps.

Hope that helps ;)

Last edited 2011


taumel(Posted 2011) [#12]
How is you collision data then setup? Do you test against a collision tileset as well or do you bake the collision data it into a bitmap?

Last edited 2011


therevills(Posted 2011) [#13]
Here is the code (without the graphics - replaced with Rects and Ovals)



Can anyone see the error? Thanks!

Last edited 2011


therevills(Posted 2011) [#14]
Uploaded a new version:

* Sound + Music
* You can now destory blocks
* 'Fixed' falling thru floor - Thanks to Matt at monkeycoder

Please test :)


Steve Elliott(Posted 2011) [#15]
I got stuck in the grass - mario was lower than he should have been. Managed to jump out. Mario doesn't always fall too. Suspended in mid-air for a while.

[EDIT]
I suspect it's a problem with delta timing.

Last edited 2011


therevills(Posted 2011) [#16]
How!?!?!? ARRRRGGHGGHGHHGHHHHH!!!!


taumel(Posted 2011) [#17]
@therevills
Cool, thanks! I'll have a look at it later on when i find some time.


therevills(Posted 2011) [#18]
Changed the updates to use a high Fixed Rate Logic ...

Does it work okay now?

http://www.therevillsgames.com/monkey/platformer/


D4NM4N(Posted 2011) [#19]
Runs nice and smooth on crome on ubuntu.