User prompt
on game start power ups should start ascending
User prompt
spawn power ups coming down up in the same line as the player
User prompt
make circle 50% transparent
User prompt
Please fix the bug: 'Uncaught TypeError: Graphics is not a constructor' in or related to this line: 'var circle = new Graphics();' Line Number: 18
User prompt
add a circle arround the player
User prompt
Add player in the center of the screen
Initial prompt
Empty game
===================================================================
--- original.js
+++ change.js
@@ -1,8 +1,29 @@
-/****
+/****
+* Classes
+****/
+// Create a player class
+var Player = Container.expand(function () {
+ var self = Container.call(this);
+ var playerGraphics = self.attachAsset('player', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+});
+
+/****
* Initialize Game
-****/
+****/
+// Add player to the game
//<Assets used in the game will automatically appear here>
//<Write entity 'classes' with empty functions for important behavior here>
var game = new LK.Game({
- backgroundColor: 0x000000 //Init game with black background
-});
\ No newline at end of file
+ backgroundColor: 0x000000 //Init game with black background
+});
+
+/****
+* Game Code
+****/
+// Add player to the game
+var player = game.addChild(new Player());
+player.x = 2048 / 2; // Center player horizontally
+player.y = 2732 / 2; // Center player vertically
\ No newline at end of file