Page 1 of 2

Walk! Jump! Collect! - A Platformer Experiment (ver 2.1)

Posted: Sun Mar 09, 2014 3:11 am
by pelicano_o
Hi people in the Love community :awesome: You can ignore my 'blabbering' by skipping my next 2 paragraphs.

This is my first topic. So I first came to know Love2D about 6 months ago. After I familiarised myself with the basics with the awesome tutorials by a lot of people, I started to experiment with my first platformer. I like platformers. for online multiplayer games, I particularly enjoy Maplestory. I also liked the Mario series and Mega Man when I was a very very small kid. I particularly enjoy games with a meaningful story element to it. Currently, my favourite games include Aquaria and Seasons( made by Joris Dormans ). So the reason why I started to learn Love2D is to eventually make a game with a meaningful message.

I learned a *ton* since I first knew Love2D. And kikito's love-tile-tutorial is rather helpful in getting me started. And the HUMP libraries proved to be more and more useful as I proceeded to experiment with platformer. I changed my code on a large scale quite a few times after I learned more concept -> scoping, meatatables, and classes. And I spent a lot of time on the tweening aspect after the basic structure of my experiment was completed.

All the art was drawn by me mostly using Paint.Net. I reused some of the art in my previous experiment drawn with an outdated (free) version of Photoshop (http://www.digitaltrends.com/computing/ ... -for-free/). You may use my art for non-commercial purposes without misrepresentation of the source. All the audio was downloaded from http://www.freesound.org.


So basically, you just need to collect all diamonds to proceed to the next level.

Collision detection is entirely tile-based: checking whether the tiles around player are passable before moving with some re-adjustment of player's position. Smooth transition between grids is implemented through assigning a value denoting player's displacement from grid positions. In fact, calculations of player's position are mostly done on this displacement thing.

Lastly, have fun getting higher scores!

Libraries used:
-HUMP
-slib
-hardon collider
-struct
-anim8

Re: Walk! Jump! Collect! - A Platformer Experiment

Posted: Sun Mar 09, 2014 4:00 am
by Positive07
8192 pixels wide canvas??? My computer is not that powerful... :ultrashocked:

As I saw in some other post you should use 1024 and 2048 pixels width since most computers are compatible with that but 8192 is a little too much :cry:. Can you shrink it please? I wanna play it :awesome:

Re: Walk! Jump! Collect! - A Platformer Experiment

Posted: Sun Mar 09, 2014 5:05 am
by pelicano_o
Positive07 wrote:8192 pixels wide canvas??? My computer is not that powerful... :ultrashocked:

As I saw in some other post you should use 1024 and 2048 pixels width since most computers are compatible with that but 8192 is a little too much :cry:. Can you shrink it please? I wanna play it :awesome:
Hi. Since some maps are large, the levels will be off the canvas and will be invisible if I just shrink the canvas. So I broke up the canvas into 12 smaller canvases( 1024 by 1024 ). I'm not sure if this will solve the problem you mentioned. ( though, loading each level takes a fraction of a second longer now )

Re: Walk! Jump! Collect! - A Platformer Experiment

Posted: Sun Mar 09, 2014 10:19 am
by Jeeper
pelicano_o wrote:
Positive07 wrote:8192 pixels wide canvas??? My computer is not that powerful... :ultrashocked:

As I saw in some other post you should use 1024 and 2048 pixels width since most computers are compatible with that but 8192 is a little too much :cry:. Can you shrink it please? I wanna play it :awesome:
Hi. Since some maps are large, the levels will be off the canvas and will be invisible if I just shrink the canvas. So I broke up the canvas into 12 smaller canvases( 1024 by 1024 ). I'm not sure if this will solve the problem you mentioned. ( though, loading each level takes a fraction of a second longer now )
There is no reason you would need more than 1 canvas the size of 1024x1024. As you only need to draw what is in the sceen at the moment.

Re: Walk! Jump! Collect! - A Platformer Experiment

Posted: Sun Mar 09, 2014 10:46 am
by pelicano_o
Jeeper wrote: There is no reason you would need more than 1 canvas the size of 1024x1024. As you only need to draw what is in the sceen at the moment.
But drawing tiles onto the canvas every frame causes black lines to appear for reasons I do not know of. I actually draw everything onto the canvas when loading each level.

EDIT: black lines appear when camera moves.

Re: Walk! Jump! Collect! - A Platformer Experiment

Posted: Sun Mar 09, 2014 10:53 am
by Jeeper
pelicano_o wrote:
Jeeper wrote: There is no reason you would need more than 1 canvas the size of 1024x1024. As you only need to draw what is in the sceen at the moment.
But drawing tiles onto the canvas every frame causes black lines to appear for reasons I do not know of. I actually draw everything onto the canvas when loading each level.

EDIT: black lines appear when camera moves.
Then there is something wrong with you camera and/or your tiles. You should always solve the actual problem rather than doing a "hack" solution.

Sounds to me like there is a tiny gap between the tiles, like 0.3 pixels. So in some positions it round the x position down instead of up (or reversed) creating a 1px gap.

Re: Walk! Jump! Collect! - A Platformer Experiment

Posted: Sun Mar 09, 2014 11:38 am
by Positive07
Yeah thats probably it, you should use 1px increments. Also make sure that you are clearing the canvas before you draw each time. Drawing the whole level is a really bad idea that can give many problems later on, you should use some kind of culling and just draw what is needed

Re: Walk! Jump! Collect! - A Platformer Experiment

Posted: Sun Mar 09, 2014 4:12 pm
by micha
Good game so far. I know it is not easy to make something complete with gamplay, menu, levels etc.

In my opinion, holding down the jump button should not make the player jump repeatedly. Instead it should only jump once. So better use the keypressed-callback instead of love.keyboard.isDown.

For drawing the map, I suggest using a spriteBatch. That way you can draw the whole map with one draw-command. You won't get drawing artifacts between the tiles, if you math.floor all drawing coordinates, before drawing.

Re: Walk! Jump! Collect! - A Platformer Experiment

Posted: Wed Apr 02, 2014 9:29 pm
by ZoNe
interesting :) has a happy feeling to it thats for sure! :) and a good stab at your first platform i must say! i like what you've done here apart from IMO i don't think you should have the fly ability.. i just found myself flying around the levels sometimes and then it wasn't enjoyable. maybe if you keep the fly ability, have a power level for it that regenerates over time and goes down whilst flying so it isn't possible to just fly everywhere.

keep it up! :)

ZoNe!

Re: Walk! Jump! Collect! - A Platformer Experiment

Posted: Thu Apr 03, 2014 9:00 pm
by Draetheus
The hand drawn graphics are a nice touch. The jumping feels nice for a platformer, and the point collecting animation is great! I agree that flying makes it too easy. The player trail animation also seems a bit excessive. But nice job overall, keep at it!