Page 2 of 2

Re: Help:gnerator level's

Posted: Wed Jun 06, 2012 9:32 am
by l3crafteur
In fact, I wish there was a first coat of "stone" and then put the block as a random grid

Otherwise thank you for your help, you are really nice!

Re: Help:gnerator level's

Posted: Wed Jun 06, 2012 10:14 am
by coffee
l3crafteur wrote:In fact, I wish there was a first coat of "stone" and then put the block as a random grid

Otherwise thank you for your help, you are really nice!
Ah, now that you explaining more in detail what you want we could get somewhere.
First:
You need a map based in a tile grid system with two layers
a) one for floor/ground (being all "stone" or not)
b) a second layer with random regenerated tiles/obstacles

Ok, so first you need to learn tile map concept. Best way to do it is by doing the tilemap tutorial in WIKI and you will get the basis of it.
Gridlock one probably fits better to you https://love2d.org/wiki/Tutorial:Gridlocked_Player but you should also do one with images and not rectangles so do also Fine Tile https://love2d.org/wiki/Tutorial:Fine_T ... _Scrolling. You should do Efficient Tile if you want to learn to do it with tiles in same image file https://love2d.org/wiki/Tutorial:Effici ... _Scrolling

But you have a worse problem looking your code. You are doing things in a not advisable way. You doing "wait" and doing raw basic Lua print. LOVE have more efficient ways of do that things. So before focus in Tiles Maps learn well Love callbacks (https://love2d.org/wiki/Tutorial:Callback_Functions) and LOVE ways of print and draw text. Doing the referred tutorials you can learn about all that.

Re: Help:gnerator level's

Posted: Wed Jun 06, 2012 10:36 am
by l3crafteur
Ok, I would say if there was a problem :D
Thank

Re: Help:gnerator level's

Posted: Wed Jun 06, 2012 5:39 pm
by l3crafteur
I do not really understand the first tutorial, we could better explain to me? :)

Re: Help:gnerator level's

Posted: Wed Jun 06, 2012 8:05 pm
by Roland_Yonaba
Are ye talking about the Gridlocked player tutorial ?
Well, what specific part of the tutorial did you not figure out ?

Re: Help:gnerator level's

Posted: Thu Jun 07, 2012 9:58 am
by l3crafteur
The first part

Re: Help:gnerator level's

Posted: Thu Jun 07, 2012 11:29 am
by Roland_Yonaba
l3crafteur wrote:The first part
Still kinda vague. Maybe you can post the part of the code that seems unclear to you ?
But, read the tutorial carefully, as it is very detailled, IMHO.
Try the samples by yourself, tweak variables, as you may not get what is stated at the first sight.

Though, I can add some clarifications on the overall purpose of the tutorial.

The first step of the tutorial is to create a player, represented by a square, with methods to make him move.
Consider grid coordinates (player.grid_x,player.grid_y) represents where we want the player to move pressing a directionnal key.
In the update loop, each dt, the player is asked to move until (player.grid_x,player.grid_y are different from player.act_x,player.act_y.

The second part (Adding collision) maps a 2D array, using nested for loops. Values inside the map tables represents either a walkable location or an unwalkable location on the grid to be drawn later.

Function testMap performs a check when a key is pressed. Before the next move is authorized, this functions retrieves the value inside the map table located a the very cell we are attempting to reach. Yet it returns true if that cell was found walkable (meaning its value was different from 1), either it returns false (meaning value equals 1).

That's all I can say...

Re: Help:gnerator level's

Posted: Sun Jun 10, 2012 12:10 pm
by l3crafteur
Thank's ! :D