Enemies spawn

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
lolsasory
Prole
Posts: 21
Joined: Mon Nov 19, 2012 5:27 am

Enemies spawn

Post 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:
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Enemies spawn

Post 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.
Help us help you: attach a .love.
lolsasory
Prole
Posts: 21
Joined: Mon Nov 19, 2012 5:27 am

Re: Enemies spawn

Post by lolsasory »

game.love
(119.97 KiB) Downloaded 259 times
this there an easier way to talk, like an im?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Enemies spawn

Post 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?
Help us help you: attach a .love.
lolsasory
Prole
Posts: 21
Joined: Mon Nov 19, 2012 5:27 am

Re: Enemies spawn

Post by lolsasory »

yes thank you
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 3 guests