function arguments

So we just have a simple bug at the top of this code and was wondering if someone could help us out. Thanks!

local function total_zombie = 100 – dis line has the bugs in it

tmr = timer.performWithDelay(2000, spawnzombie, total_zombie);

– BUTTON code

local widget = require( “widget” )

local function handleButtonEvent( event )

        local phase = event.phase

        if “ended” == phase then

                print( “you pressed and released a button!” )

        end

end

– guns

local function fireLasers()

  local laserbeam = display.newImage(“laserbeam.jpg”)

  laserbeam:scale( 0.5, 0.5 )

  laserbeam.x = happy.x

  laserbeam.y = happy.y

  physics.addBody(happy, “dynamic”)

  transition.to(laserbeam, {time=1000, x = math.random() ,y = math.random(), onComplete=movelaserbeam});

end

local fireButton = display.newImage( “firebutton.jpg” )

fireButton.x = 50

fireButton.y = display.contentHeight-50

local function handleFireButton( event )

        if ( event.phase == “began” ) then

                fireLasers()

        elseif ( event.phase == “ended” ) then

                fireLasers()

        end

        return true

end

fireButton:addEventListener( “touch”, handleFireButton )

local needToFire = false

local function handleEnterFrame( event)

        if ( needToFire == true ) then

                fireLasers()

        end

end

Runtime:addEventListener( “enterFrame”, handleEnterFrame )

local fireButton = display.newImage( “firebutton.jpg” )

fireButton.x = 50

fireButton.y = display.contentHeight-50

local function handleFireButton( event )

                if ( event.phase == “began” ) then

                        needToFire = true

                elseif ( event.phase == “ended” and needToFire == true ) then

                needToFire = false

        end

        return true

end

fireButton:addEventListener( “touch”, handleFireButton )

– ugh

local needToFire = false

local function handleEnterFrame( event )

   if ( needToFire == true ) then

      fireLasers()

   end

end

Runtime:addEventListener( “enterFrame”, handleEnterFrame )

local function handleFireButton2( event )

   if ( event.phase == “began” ) then

      – fire the weapon

      needToFire = true

   elseif ( event.phase == “ended” and needToFire == true ) then

      – stop firing the weapon

      needToFire = false

   end

   return true

end

local fireButton2 = widget.newButton{

   width = 64,

   height = 64,

   defaultFile = “firebutton.jpg”,

   overFile = “button1.jpg”,

   onEvent = handleFireButton

}

fireButton.x = 50

— splash screen?

local splashscreen = display.newImage( “ins.png” );

local removesplashbutton  --up-value reference

local function removeSplash( event )

   splashscreen:removeSelf()

   removesplashbutton:removeSelf()

end

removesplashbutton = widget.newButton{

        width = 100,

        height = 100,

        defaultFile = “smallbutton.png”,

        overFile = “button1.jpg”,

        onPress = removeSplash,

}

You’ve got “local  function total_zombie” instead of “local total_zombie”.

  • Caleb

You’ve got “local  function total_zombie” instead of “local total_zombie”.

  • Caleb