Log In  

28

Cart [#28248#] | Copy | Code | 2016-09-09 | Link
28

The goal of this cart is to demonstrate a very basic platforming engine in under 100 lines of code (comments don't count), while still maintaining an organized and documented game.

It is not meant to be a demo of doing as much as possible, in as little code as possible (a la demo scene). The 100 line limit is just meant to encourage people that "Hey, you can make a game with very little coding!"

This will hopefully give new users a simple and easy to understand starting point for their own platforming games.

Note: Collision routine is based on Super Mario Bros 2 and M.C. Kids, where we use collision points rather than a box. this has some interesting bugs but if it was good enough for miyamoto, its good enough for me!

Built on a PocketC.H.I.P.!

engine platformer
P#28249 2016-09-09 20:33

::

This is great, thanks for sharing. Platform jumping is something I have yet to really grasp and get working successfully...this should go a long way to remedy that.

P#28250 2016-09-09 22:34

::

Just have to comment. Firefox REALLY runs these great games so slow ! And then Chrome just breezes right through them. What gives ?

P#28252 2016-09-10 00:32

::

@morningtoast: Glad you find some value in it. Let me know if you have any feedback to make it easier to use for others.

@dw817: I actually find it pretty choppy even in Chrome; especially noticeable with input lag.

P#28253 2016-09-10 00:58

::

Great engine, I'm gonna make a game out of this :P
Edit: I'm coding it on my PocketC.H.I.P. too! :P

P#28264 2016-09-10 09:37

::

With firefox, Micro Platformer is smooth for me (Intel(R) Core(TM)2 Duo CPU P8400 @ 2.26GHz)
Nice demo anyway, I might use it as basis as well...

P#28265 2016-09-10 10:09

::

MHughson:

Choose one browser or the other to be your primary. Then clear All TABS from the other browser and load only PICO games in it.

It should run fast with no hesitation.

Funzrey:

How are you liking the keyboard ? Looking at a picture of it I'm still wondering where the arrow keypresses are.

P#28275 2016-09-10 13:19

::

Keyboard is pretty bad to be honest. Took a lot of getting used to even just to type. Gaming on it is even tougher. However, its pretty cool do be able to do anything like pico 8 programming in the go so I put up with it :)

P#28289 2016-09-10 19:06

::

@mhughson I usually hook up a bluetooth keyboard if the coding gets pretty hardcore as I don't want to kill my fingers; pressing them a lot for a long time does hurt, though. :P Bluetooth does suck the battery though.

@dw817 Pretty nice once you get used to it, long periods of time can hurt because it's clicky. Arrows are at the top left corner next to the escape key and numbers.

EDIT: My game is going to be based off this engine! Still working out a story on it, also how does it detect what blocks to collide with? I need help with that so I can add my own blocks.

P#28291 2016-09-10 20:05

::

@funzrey: any tile/sprite with flag 0 enabled (red dot). Look up fget function for more info. Post a link once you have something up and running. Would love to see what you make.

P#28322 2016-09-11 14:42

::

@mhughson Oh, thanks. I'm working on it and it looks pretty good so far.

P#28325 2016-09-11 15:43

::

Alright! Here's a demo of my game so far, it's quite buggy and the level switching isn't completely implemented, but I thought I'd release it and show you how much I've done:

Cart [#28349#] | Copy | Code | 2016-09-11 | Link
0

Sorry for no cart picture. I tried FN+7 (F7) on PocketC.H.I.P to take a picture but it didn't work.

P#28350 2016-09-11 19:20

::

My ball ends up halfway inside a wall if I jump over it and then fall down into it. :( Only one collision point in the center rather than on the corners, I guess.

P#28381 2016-09-12 06:39

::

@JTE I don't know where the collision points are either. :P

Anyway, my game has a lot more sounds now
[8x8]
and the map switching is implemented! Now to implement the collision changing part, because right now it only changes map display & spawn location. I'll release it as soon as I can get it working. (though would be nice if I had some help on the collision part)

//OFFTOPIC: PICO-8 emotes pack!
[32x8]

P#28427 2016-09-12 17:47

::

@funzrey: Nice work! Looking forward to the full game!

@JTE: Look for the calls the MGET. The collision points are usually in there (represented as offsets from the top left position of the player).

--check bottom center of the
--player.
local v=mget((p1.x+4)/8,(p1.y+8)/8)

In this case we offset to the middle bottom. If want to check for more than 1 point you would make this call multiple times with slightly different offsets (then call FGET for each).

For example, here is what it would look like if you wanted to check on the bottom left and right corners instead of the bottom center:

--bottom left
local v1=mget((p1.x+0)/8,(p1.y+8)/8)
local v2=mget((p1.x+8)/8,(p1.y+8)/8)

if fget(v1,0) or fget(v2,0) then
...
P#28708 2016-09-17 19:25

::

@funzrey: BallQuest, the spikes are way too easy to hit. The full sprite is death when it should be just falling on it you die. :(

P#28776 2016-09-18 22:22

::

microenginejam anyone?

P#29447 2016-09-26 17:48

::

Yep, if you're checking true collision, it should be fine. Now one person made an interesting platformer. You can MOVE over the spikes but you =CAN= fall on them, and that includes jumping in place when the spikes are around you. It will cost a life.

But by being able to walk around the spikes without getting killed, that makes for some interesting puzzle levels.

P#29458 2016-09-26 20:18

::

Neat!

P#29497 2016-09-27 10:18

::

Thank you matt! It's a very useful base for a starter!

P#36727 2017-01-26 12:57

::

Glad you liked it @Baerius. I have a more advanced version coming out any day now, based on my game, Kid Bludd.

P#37100 2017-02-03 01:04

::

>>if it was good enough for miyamoto, its good enough for me!

they changed it for the Super Mario All-Stars rerelease :)

The version of Super Mario Bros. 2 included in the compilation has improved graphics 
and sound to match the Super NES's 16-bit capabilities, 
as well as minor alterations in some collision mechanics. 

https://en.wikipedia.org/wiki/Super_Mario_Bros._2

P#39969 2017-04-26 16:02

::

Haha wow, I didn't know that. I need to rethink... EVERYTHING! :D

P#39972 2017-04-27 01:19

Log in to post a comment

user:
password:

New User | Account Help
:: New User
X
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2017-05-28 16:31 | 0.272s | 1835k | Q:41