Well here's what I got so far:
// Project: enemyloadingattempt
// Created: 2015-09-14
// set window properties
SetWindowTitle( "enemyloadingattempt" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
global oldtime#
global newtime#
oldtime# = timer()
//enemy types
type tenemy
etype as integer
health as integer
damage as integer
shotinterval as float
spr as integer
endtype
type twave
id as integer
spawninterval as float
enemy as tenemy[10]
endtype
global line = 0
global circle = 1
global arrWave as twave[1]
initEnemies()
do
spawnEnemies()
newtime# = timer()
print(oldTime#)
print(newtime#)
print(i)
print(j)
Print( ScreenFPS() )
Sync()
loop
function initEnemies()
//wave 1
arrWave[1].spawninterval = 1
arrWave[1].enemy[1].etype = line
arrWave[1].enemy[2].etype = circle
arrWave[1].enemy[3].etype = line
arrWave[1].enemy[4].etype = circle
arrWave[1].enemy[5].etype = line
arrWave[1].enemy[6].etype = circle
arrWave[1].enemy[7].etype = line
arrWave[1].enemy[8].etype = circle
arrWave[1].enemy[9].etype = line
arrWave[1].enemy[10].etype = circle
endfunction
global i = 1
global j = 1
global x = 0
global y = 0
function spawnEnemies()
if i < arrWave.length and j >= arrWave[i].enemy.length
inc i, 1
endif
if newtime# > oldtime# + arrWave[i].spawninterval and j <= arrWave[i].enemy.length
arrWave[i].enemy[j].spr = CreateSprite(0)
SetSpriteOffset(arrWave[i].enemy[j].spr, GetSpriteWidth(arrWave[i].enemy[j].spr)/2, GetSpriteHeight(arrWave[i].enemy[j].spr)/2)
SetSpritePositionByOffset(arrWave[i].enemy[j].spr, x, y)
x = x + 50
y = y + 50
if j < arrWave[i].enemy.length then inc j, 1
oldtime# = newtime#
endif
endfunction
not quite working, was going to use for loops, but that wouldn't allow me to spawn them by a time variable. any thoughts?
-Stupinator