I am making a 2d game, you start out on a flat grass plane (ITS tiles) and theres a store to your left and a cave to your right, on the first level it is mandatory to go into the store first. You walk in and recieve a wooden sword and pickaxe(for free). You leave the store and enter the cave. The cave is a dungeon, full of goblins evil skelotons and zombies. It is mainly vertical and you goal is to reach the bottom. As you go down through the 48 x 48 stone blocks you may see some diamond in the wall, you can mine it with your wooden pickaxe, and with that diamond you can buy stuff at the store!
So my idea is that there is a survival mode; You go through as many randomly generated dungeons as possible.
and an arcade mode; You go through 20-30 premade levels with an amazing surprise boss.
so far i have a flat grass tile map, character animations, and all the player can do is move left or right
I have a few questions..
I have been having trouble trying to make the character jump. I know how to make a timer, but I couldn't quite get it right. I tried saying..
Code: Select all
if lovekeyboard.isDown("w") then
gravity = false
timer_jumping = timer_jumping + dt
blah blah blah
Another thing is collisions with my tilemaps. Ive tried everything. But then i looked at a forum post where someone said something like.
"set the property list for tiles,with a bolean being ''solid = true or solid = false''" and stuff like that. I also saw someone talk about
"check if the block is occupied" but im unsure of how to set the properties for either of those. But if i could im sure i could figure out the rest on my own.
Although i don't mind detailed advice ^.^
Some bits of code are...
Tile map layout...
Code: Select all
tiletable1={
{ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
{ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
{ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
{ 2,2,2,2,2,2,2,2,2,2,3,2,2,2,2,2,2,2,2,2},
{ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
{ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}
Code: Select all
for rowIndex=1, #tiletable1 do
local row = tiletable1[rowIndex]
for columnIndex=1, #row do
local number = row[columnIndex]
love.graphics.draw(tiles[number], (columnIndex-1)*48, (rowIndex-1)*48)
end
end
Code: Select all
if love.keyboard.isDown("(whatever)") then
steve.x = steve.x + steve.speed * dt
please help me i will love you forever!