Page 1 of 1

Adding health, damage, baddies and powerups to my game.

Posted: Mon Jul 16, 2012 5:51 pm
by Mr_Gentoo
I've been following a tutorial on explodingrabbit.com about making a platformer. I've learned a lot about love2d and am enjoying it so far. I want to expand the game I have and add things to it.. trouble is.. I don't know where to start out... and I only know a little bit. I would think I have to add some stuff to the Player.lua file for abilities and stuff but I'm really not too sure. I'll post the love file because this is what I have so far. This is a learning experience from me and I'd appreciate it if you would give me a hand in learning how to add:

some kind of health system, damage, baddies and a way to send my character back to start if I fall off the map. I'm using the AdvancedTileLoader as that is the best way to make maps for myself.

(x, left, right) = controls.

Re: Adding health, damage, baddies and powerups to my game.

Posted: Tue Jul 17, 2012 3:05 am
by Jasoco
Just think of your player (And enemies and everything else) as an object. Your player might be set up as a table like this:

Code: Select all

player = {
  name = "Jason",
  health = 10,
  power = 2,
  armor = 10,
  lives = 3,
  coins = 99,
  etc = "and so on..."
}