Re: Multiple Charecters
Posted: Tue Feb 10, 2015 11:16 pm
almost. That one "Player" shouldn't be capitalized and the first "end" doesn't make sense and should be removed.pactace wrote:So something like thisCode: Select all
player1 = { x = 256, y = 256, x_vel = 0, y_vel = 0, jump_vel = -4000, speed = 400, flySpeed = 859, state = "", h = 55, w = 45, standing = false, } player2 = { x = 256, y = 256, x_vel = 0, y_vel = 0, jump_vel = -4000, speed = 400, flySpeed = 859, state = "", h = 55, w = 45, standing = false, } player3 = { x = 256, y = 256, x_vel = 0, y_vel = 0, jump_vel = -4000, speed = 400, flySpeed = 859, state = "", h = 55, w = 45, standing = false, } player4 = { x = 256, y = 256, x_vel = 0, y_vel = 0, jump_vel = -4000, speed = 400, flySpeed = 859, state = "", h = 55, w = 45, standing = false, } Player = player1 end function love.keypressed(k) if k == 1 then player = player1 elseif k == 2 then player = player2 elseif k == 3 then player = player3 elseif k == 4 then player = player4 end end