Page 1 of 1

Enemies spawn

Posted: Sat Nov 24, 2012 10:08 pm
by lolsasory
Im really confused on all the tutorials so far an I wondering if anyone could help

I need enemies to spawn anywhere between x = -64 and x = 664
every 1 - 5 seconds
in groups of 1 - 10 (all in random spots between x = -64 and x = 664)
going a number between .8 and 1.2 times player.y *-1 example (player.y * .846) * -1
and the image to be resized from .8 time bigger to 1.2 times bigger

I know this is alot but if someone could tell me the code and where to put it i would be forever greatful :awesome:

Re: Enemies spawn

Posted: Sat Nov 24, 2012 10:23 pm
by Robin
What is your code so far? (Please upload as a .love)

These things are very simple to write, and I'm willing to walk you through this, but it helps if I know where we start.

Re: Enemies spawn

Posted: Sat Nov 24, 2012 10:29 pm
by lolsasory
game.love
(119.97 KiB) Downloaded 259 times
this there an easier way to talk, like an im?

Re: Enemies spawn

Posted: Sat Nov 24, 2012 11:11 pm
by Robin
lolsasory wrote:this there an easier way to talk, like an im?
LÖVE has an IRC channel (#love@irc.oftc.net). I'm not currently online there, but someone else willing to help you may be.

Here's a start:

Code: Select all

baddies = {}
function spawnbaddie()
     baddies[#baddies+1] = {x = math.random(-64, 664), imgscale = math.random() * 0.4 + 0.8}
end
Do you know what everything here does?

Re: Enemies spawn

Posted: Sun Nov 25, 2012 4:59 am
by lolsasory
yes thank you