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!
Help:gnerator level's
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Help:gnerator level's
Ah, now that you explaining more in detail what you want we could get somewhere.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!
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.
-
- Prole
- Posts: 9
- Joined: Mon Jun 04, 2012 4:33 pm
Re: Help:gnerator level's
Ok, I would say if there was a problem
Thank
Thank
-
- Prole
- Posts: 9
- Joined: Mon Jun 04, 2012 4:33 pm
Re: Help:gnerator level's
I do not really understand the first tutorial, we could better explain to me?
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: Help:gnerator level's
Are ye talking about the Gridlocked player tutorial ?
Well, what specific part of the tutorial did you not figure out ?
Well, what specific part of the tutorial did you not figure out ?
-
- Prole
- Posts: 9
- Joined: Mon Jun 04, 2012 4:33 pm
Re: Help:gnerator level's
The first part
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: Help:gnerator level's
Still kinda vague. Maybe you can post the part of the code that seems unclear to you ?l3crafteur wrote:The first part
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...
Who is online
Users browsing this forum: Bing [Bot] and 2 guests