{"assets":{"script":[{"Game":{"type":"game script","start":"#self refers to the game class\r\n\r\n#self.bg is creating a new variable \"bg\" and setting it to the background object\r\nself.bg = Background(sprite(\"background.jpg\"))\r\n\r\n#self.runner is creating a new variable \"runner\" and setting it to Timone\r\nself.runner = Timone()\r\nself.runner.x = -800\r\nself.runner.y = 300\r\n\r\n#self.player is creating a new variable \"player\" and setting it to Pumba\r\n#we set the players y position to be -250, and set the speed to 5\r\nself.player = Pumba()\r\nself.player.y = -250\r\nself.player.speed = 1\r\n\r\n","loop":"\r\nif key_is_pressed(\"a\"):\r\n self.player.x -= self.player.speed\r\n self.player.scaleX = -1\r\n \r\nif key_is_pressed(\"d\"):\r\n self.player.x += self.player.speed\r\n self.player.scaleX = 1\r\n "}},{"Pumba":{"type":"object script","start":"#Pumba start\n\nset_animation(self, animation(sprite(\"pumba.png\",1,5), 10, 0, 4))\n","loop":"#Pumba loop\n\nbug = get_collision(self, \"Bug\")\nif bug:\n destroy(bug)\n\n"}},{"Timone":{"type":"object script","start":"\nself.bugTimer = 30\nset_animation(self, animation(sprite(\"timon.png\",1,8), 30, 0, 7))\n","loop":"#Timon loop\n\nimport random\n\n#move right\nself.x += 10\n\n#if it's too far to the right, teleport left\nif self.x > 800:\n self.x = -800\n\n#count down the timer, when the timer counts down to zero, drop a bug\n#i made it fancy here dropping different coloured bugs at random intervals\n#to simplify, you could only drop one time of bug, and remove the randomness\nself.bugTimer -=1\nif self.bugTimer < 0:\n self.bugTimer = random.randint(0, 15) + 60\n r = random.randint(1, 3)\n if r == 1:\n b = Bug(sprite(\"yellowbug.png\"))\n b.speed = 1\n if r == 2:\n b = Bug(sprite(\"redbug.png\"))\n b.speed = 2\n if r == 3:\n b= Bug(sprite(\"bluebug.png\"))\n b.speed = 3\n b.x = self.x\n b.y = self.y\n\n "}},{"Background":{"type":"object script","start":"#Background start\n\nself.scaleX = 2\nself.scaleY = 2","loop":"#Background loop\n\n"}},{"Bug":{"type":"object script","start":"#Bug start\n\n","loop":"#Bug loop\n\n#during the workshop, we wrote: self.y -= 1\n#this means that all bugs fall at the same rate\n#you could simplify the code below for your lessons\n#look at Timone's LOOP code to see how is the speed\n\nself.y -= self.speed\n\n\n"}}],"room":[],"texture":[{"bluebug.png":{"type":"image","uri":"https://s3.us-west-1.amazonaws.com/media.pixelpad.io/__ASSET__.18843.218186.1613129793.bluebug.png"}},{"yellowbug.png":{"type":"image","uri":"https://s3.us-west-1.amazonaws.com/media.pixelpad.io/__ASSET__.18843.218186.1613129797.yellowbug.png"}},{"redbug.png":{"type":"image","uri":"https://s3.us-west-1.amazonaws.com/media.pixelpad.io/__ASSET__.18843.218186.1613129802.redbug.png"}},{"timon.png":{"type":"image","uri":"https://s3.us-west-1.amazonaws.com/media.pixelpad.io/__ASSET__.18843.218186.1613129806.timon.png"}},{"pumba.png":{"type":"image","uri":"https://s3.us-west-1.amazonaws.com/media.pixelpad.io/__ASSET__.18843.218186.1613129811.pumba.png"}},{"background.jpg":{"type":"image","uri":"https://s3.us-west-1.amazonaws.com/media.pixelpad.io/__ASSET__.18843.218186.1613129815.background.jpg"}}],"sound":[],"function":[]}}