// ****************************** // HBS New features of 01/02/2012 // ****************************** // Discs now have a new property: // "speed" : [xspeed, yspeed] - Let's you set an initial speed for the disc. It's useful for initializing moving obstacles. // There are now "playerPhysics" and "ballPhysics" structures. // They both share most of the physical properties of discs, with the exception that you cannot set the initial speed or position. // You can't alter the radius, collision group or collision layer of the player structure ( you can do so for the ball though ). // The player structure also contains some extra properties that let you set the kick strength and other settings. // *********************************************** // A simple stadium demostrating the new features: // *********************************************** { "name" : "New HBS Features", "width" : 450, "height" : 200, "spawnDistance" : 200, "bg" : { "type" : "grass", "width" : 400, "height" : 200, "kickOffRadius" : 75, "cornerRadius" : 0 }, //"vertexes" : [], //"segments" : [], //"goals" : [], // Player physics set to the game's default values: "playerPhysics" : { // The following three settings work in the same way as in discs "bCoef" : 0.5, "invMass" : 0.5, "damping" : 0.96, "acceleration" : 0.1, // This is how fast the player accelerates when moving in any direction. "kickingAcceleration" : 0.07, // This value will replace normal acceleration when the player is pressing the kick button. ( Setting it to the same value as acceleration would make the player not slow down when kicking ) "kickingDamping" : 0.96, // This value will replace the normal damping when the player is pressing the kick button. ( By default this is set to the same value as normal damping, meaning that classic haxball doesn't make use of this feature. ) "kickStrength" : 5 // This value is the strength with which the ball will be kicked by the players. }, // Ball physics set to the game's default values: "ballPhysics" : { "radius" : 10, "bCoef" : 0.5, "invMass" : 1, "damping" : 0.99, "color" : "FFFFFF", "cMask" : ["all"], "cGroup" : ["ball"] }, "discs" : [ { "pos" : [ 75, 75], "speed" : [0, 1.1], "invMass": 0.0001, "bCoef" : 1, "radius" : 15, "damping" : 1 }, // A very heavy obstacle initialized to move downwards { "pos" : [-75, -75], "speed" : [0,-1.1], "invMass": 0.0001, "bCoef" : 1, "radius" : 15, "damping" : 1 } // A very heavy obstacle initialized to move upwards ], "planes" : [ { "normal" : [ 0, 1], "dist" : -200, "bCoef" : 1 }, // Top wall. { "normal" : [ 0,-1], "dist" : -200, "bCoef" : 1 }, // Bottom wall. { "normal" : [ 1, 0], "dist" : -400, "bCoef" : 1 }, // Left wall. { "normal" : [-1, 0], "dist" : -400, "bCoef" : 1 } // Right wall. ], "traits" : { } }