For some reason the timer (Destroyer_Update) is not executing more that once. Am I declaring it wrong? How should I be declaring it?
[lua]
–
– Destroyer.lua
–
------------------------------------------------------------------file inclusion
local Destroyer = require( “Destroyer” )
------------------------------------------------------------------file inclusion
------------------------------------------------------------------forward declerations
local Create_Destroyer
------------------------------------------------------------------forward declerations
------------------------------------------------------------------VARIABLES
local in_game = display.newGroup()
------------------------------------------------------------------VARIABLES
------------------------------------------------------------------START FUNCITON
local function Start()
print(“The Game Has Started”)
Create_Destroyer(0,0)
in_game.x=display.contentWidth/2
in_game.y=display.contentHeight/2
end
------------------------------------------------------------------START FUNCTION
------------------------------------------------------------------RUNTIME FUNCTIONS
local function Destroyer_Update(Destroyer)
Destroyer:make_money(5)
print(1)
end
------------------------------------------------------------------RUNTIME FUNCTIONS
------------------------------------------------------------------SINGLE FUNCTIONS
function Create_Destroyer(x,y)
local Destroyer1 = Destroyer.new(x,y) – creates the destroyer class object
timer.performWithDelay( 1, Destroyer_Update(Destroyer1),10) – gives it a runtime funciton
in_game:insert( Destroyer1.object )
end
------------------------------------------------------------------SINGLE FUNCTIONS
------------------------------------------------------------------FUNCTION CALLS AND DECLERATIONS
Start() --Calls the initial “Start” function that initiates the program
------------------------------------------------------------------FUNCTION CALLS AND DECLERATIONS
[/lua]