Search found 16 matches

by ZoNe
Sun Feb 09, 2014 10:08 pm
Forum: General
Topic: How to make a restart button? :/
Replies: 12
Views: 10483

Re: How to make a restart button? :/

sorry typo there.. meant "enemy.spawned" :) yeah, I've added... enemy = {} function enemy.load() enemy.spawned = {} screenWidth = love.graphics.getWidth() enemy.width = 25 enemy.height = 25 enemy.friction = 10 enemy.speed = 50 enemy.xvel = 0 enemy.yvel = 0 enemy.timer = 0 enemy.timerLim = ...
by ZoNe
Sat Feb 08, 2014 8:18 pm
Forum: General
Topic: How to make a restart button? :/
Replies: 12
Views: 10483

Re: How to make a restart button? :/

okay...like this?... enemy = {} function enemy.load() screenWidth = love.graphics.getWidth() enemy.width = 25 enemy.height = 25 enemy.friction = 10 enemy.speed = 50 enemy.xvel = 0 enemy.yvel = 0 enemy.timer = 0 enemy.timerLim = math.random(1,2) enemy.spawnX = math.random(0, screenWidth - enemy.width...
by ZoNe
Sat Feb 08, 2014 12:26 am
Forum: General
Topic: How to make a restart button? :/
Replies: 12
Views: 10483

Re: How to make a restart button? :/

ahh cool thought you might of meant that after i figured it out :) For the enemies, just do EnemyTableName = {} What I would recommend doing is setting a table where you store all the enemies you make. Then, reset that table. im not sure i know what you mean.. this is how i have spawned them... enem...
by ZoNe
Fri Feb 07, 2014 8:39 pm
Forum: General
Topic: How to make a restart button? :/
Replies: 12
Views: 10483

Re: How to make a restart button? :/

aha... did this... function button.click(x,y) for i,v in ipairs(button) do if x > v.x and x < v.x + button_font:getWidth(v.text) and y > v.y and y < v.y + button_font:getHeight() then if v.id == "play" then gamestate = "playing" end if v.id == "quit" then love.quit() en...
by ZoNe
Fri Feb 07, 2014 8:15 pm
Forum: General
Topic: How to make a restart button? :/
Replies: 12
Views: 10483

Re: How to make a restart button? :/

hi, and thank you :) thanks for your response too :) Make a start menu state, which resets all variables and stuff. This also brings up options, configurations, what ever. Anyway, if the person clicks "Restart", just bring them to the start menu! That way, since you're already cleared all ...
by ZoNe
Fri Feb 07, 2014 12:20 am
Forum: General
Topic: How to make a restart button? :/
Replies: 12
Views: 10483

How to make a restart button? :/

Hey, i am extremely new to programming in general (3 weeks) and after abit of research i chose .lua as my first language to learn :) so far i love LOVE and have spent every minute spare having a go at learning how to programme using it :) From a mixture of you-tube tutorials and a fair bit of head s...