Page 1 of 1

Lovely People Helping a Misguided child in Game Dev.

Posted: Mon May 06, 2013 4:36 am
by BulbaMander
So today at percisly 5:04 I was inspired to make a game. So I started to. This is what I have. I would apreciate ideas and ways to make my code more effiecient/organized. Piece.

[EDIT]: it sounds like its done its noo000oo0oo0o0o where near being done but i dont want to make a lengthy post about it.

Re: Some stupid thread about some stupid kid's game

Posted: Mon May 06, 2013 5:16 am
by retrotails
BulbaMander wrote:So today at percisly 5:04 I was inspired to make a game. So I started to. This is what I have. I would apreciate ideas and ways to make my code more effiecient/organized. Piece.

[EDIT]: it sounds like its done its noo000oo0oo0o0o where near being done but i dont want to make a lengthy post about it.
Could you possibly add arrow key support for us non-QWERTY users?
edit: I kinda like the game for some reason. I also love the code, are you more familiar with another language?

Re: Some stupid thread about some stupid kid's game

Posted: Mon May 06, 2013 6:35 am
by Plu
Nice little game. It crashed after a few levels; I'm not sure if it's just because it ran out or because it's a bug.

Error notice was:
Dungeon.lua line:88: attemp to get length of field '?' (a nil value)

Re: Some stupid thread about some stupid kid's game

Posted: Mon May 06, 2013 8:56 am
by rhezalouis
Hi BulbaMander, nice game. ^^

P.S. What on earth is wrong with your post subject ... . Don't you think it disrespect yourself and those who respond to it? :huh: "Tiled Dark Corridor Maze" or "Can't Get Out" or something along those lines would be relevant I suppose. And since you don't ask anything, probably this post is a showcase that would find it's home in the Projects and Demos instead of Support and Development. Just my tuppence worth :roll:.

You could add quick floor check before the player could go to the next level. And some meaningful names might help to debug the code later on.

Code: Select all

function checkMap(x, y)
  local tileRow = (p.y/32)+1+y
  local tileCol = (p.x/32)+1+x
  local tileType = floor[game.lvl][tileRow][tileCol]
  
  local isPassable = true
  if tileType == 1 then
    isPassable = false
  elseif tileType == 2 and floor[game.lvl + 1] then
    game.lvl = game.lvl + 1
  end
  
  return isPassable
end
Otherwise, this would happen:
Plu wrote:Nice little game. It crashed after a few levels; I'm not sure if it's just because it ran out or because it's a bug.

Error notice was:
Dungeon.lua line:88: attemp to get length of field '?' (a nil value)
It's game.lvl == 6; but the floor[6] is not defined yet. :crazy:

Re: Some stupid thread about some stupid kid's game

Posted: Mon May 06, 2013 7:17 pm
by BulbaMander
rhezalouis wrote:Hi BulbaMander, nice game. ^^

P.S. What on earth is wrong with your post subject ... . Don't you think it disrespect yourself and those who respond to it? :huh: "Tiled Dark Corridor Maze" or "Can't Get Out" or something along those lines would be relevant I suppose. And since you don't ask anything, probably this post is a showcase that would find it's home in the Projects and Demos instead of Support and Development. Just my tuppence worth :roll:.

You could add quick floor check before the player could go to the next level. And some meaningful names might help to debug the code later on

Otherwise, this would happen:
Plu wrote:Nice little game. It crashed after a few levels; I'm not sure if it's just because it ran out or because it's a bug.

Error notice was:
Dungeon.lua line:88: attemp to get length of field '?' (a nil value)
It's game.lvl == 6; but the floor[6] is not defined yet. :crazy:
Yea I am aware of the game crashing after the 5th level, im planning on having 15 levels, then having enemies spawn when you get to the bottom and grab the treasure.
Plu wrote:Nice little game. It crashed after a few levels; I'm not sure if it's just because it ran out or because it's a bug.

Error notice was:
Dungeon.lua line:88: attemp to get length of field '?' (a nil value)
Well thanks Im not sure if I'd call it a game yet though haha
retrotails wrote:
BulbaMander wrote:So today at percisly 5:04 I was inspired to make a game. So I started to. This is what I have. I would apreciate ideas and ways to make my code more effiecient/organized. Piece.

[EDIT]: it sounds like its done its noo000oo0oo0o0o where near being done but i dont want to make a lengthy post about it.
Could you possibly add arrow key support for us non-QWERTY users?
edit: I kinda like the game for some reason. I also love the code, are you more familiar with another language?

Nope, lua was the first language I learned, then I learned java and the C languages, but lua is still my favorite. And yea arrows is what ill do next I guess with more levels, and fixing the attack button (I bet you didn't even know you could attack, its the space bar) to disapear out of your FOV and maybe race choice along with a menu.

Re: Lovely People Helping a Misguided child in Game Dev.

Posted: Tue May 07, 2013 2:45 pm
by Germanunkol
Plays really well, nicely done :)
I like the graphics and the movement, it's quick and feels nice.

Re: Lovely People Helping a Misguided child in Game Dev.

Posted: Tue May 07, 2013 9:58 pm
by BulbaMander
Germanunkol wrote:Plays really well, nicely done :)
I like the graphics and the movement, it's quick and feels nice.

:ultrahappy: :ultrahappy: :ultrahappy: :ultrahappy: :ultrahappy: :ultrahappy: :ultrahappy: :ultrahappy: :ultrahappy: :ultrahappy: :ultrahappy: :ultrahappy: :ultrahappy: :ultrahappy:

Re: Lovely People Helping a Misguided child in Game Dev.

Posted: Wed May 08, 2013 5:58 am
by T-Bone
Isn't it a little strange that the blue square moves smoothely but the light around it moves in discrete steps?

Re: Lovely People Helping a Misguided child in Game Dev.

Posted: Wed May 08, 2013 6:37 am
by Germanunkol
It is strange, but it's exactly what I liked... I think this setup "feels" nice. Can't really explain it better :P

Re: Lovely People Helping a Misguided child in Game Dev.

Posted: Wed May 08, 2013 7:17 pm
by BulbaMander
T-Bone wrote:Isn't it a little strange that the blue square moves smoothely but the light around it moves in discrete steps?
I wish I could do that, but the map draws tiles depending on distance from the player, its not like there is light or anything that is being cast from the player so I have no idea how to sync that with the players movements. I guess I could use the players smooth coords for the distance formula but that would just have odd timing and not worth it because the game is still drawing whole squares. Should I just get rid of smooth movement? Or jsut make it really fast so it's still there but less noticable that the light isnt synced?
Germanunkol wrote:It is strange, but it's exactly what I liked... I think this setup "feels" nice. Can't really explain it better :P
:ultrahappy: [insert a thumbs up]