A Simple Shooter Doesn't Work?



  • So I am pretty sure I followed the tutorial right but when I go to run it nothing happens it's just a blank window. Did I do something wrong?



  • My guess is that you haven't set HXP.scene to the GameScene you created. (For some reason the tutorial doesn't mention this step.) Make sure that you have this inside the Main.hx file:

    override public function init()
    {
    	HXP.scene = new GameScene();
    }
    


  • Well after doing that I now get this.
    src/entities/Ship.hx:45: characters 37-45 : Class<haxepunk.HXP> has no field sign

    And it takes me to the ship.hx and brings me to this line "velocity = maxVelocity * HXP.sign(velocity);"

    P.S: If I remove the line the game runs but I'm not sure if this line does anything important...


  • administrators

    sign and other math functions that were on HXP have been moved to haxepunk.math.MathUtil.


Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.