{"assets":{"script":[{"Game":{"type":"game script","start":"# Variables\r\nself.speed = 4\r\nself.money = 0\r\n\r\nself.health = 5\r\nself.maxHealth = 5\r\n\r\nself.py = 0\r\nself.px = 0\r\n\r\n# first room\r\nset_room(\"Field\")","loop":"\r\n\r\nif key_was_pressed(\"$\"):\r\n print(self.money)\r\n\r\n"}},{"Player":{"type":"object script","start":"#Player start\nself.sprite = sprite_new(\"playerSprite.png\")\n\nself.direction = \"down\"\n\nself.invTimer = 0","loop":"#Player loop\n# Movement\nif key_is_pressed(\"w\"):\n self.direction = \"up\"\n self.y = self.y + game.speed\nif key_is_pressed(\"s\"):\n self.direction = \"down\"\n self.y = self.y - game.speed\nif key_is_pressed(\"a\"):\n self.direction = \"left\"\n self.x = self.x - game.speed\nif key_is_pressed(\"d\"):\n self.direction = \"right\"\n self.x = self.x + game.speed\n\n# Collisions\nif collision_check(self, \"Coin\"):\n game.money = game.money + 1\n self.thisCoin = collision_check(self, \"Coin\")\n destroy(self.thisCoin)\n\nif collision_check(self, \"Enemy\") and self.invTimer < 0:\n game.health -= 1\n self.invTimer = 60\n print(\"Ouch!\")\n\nif collision_check(self, \"HealthPickup\") and key_is_pressed(\"e\"):\n game.health += 1\n print(\"I feel a little better\")\n self.thisHealthItem = collision_check(self, \"HealthPickup\")\n destroy(self.thisHealthItem)\n\n# Attack\nif key_is_pressed(\" \"):\n self.attack = Attack()\n self.attack.y = self.y\n self.attack.x = self.x\n if self.direction == \"up\":\n self.attack.sprite = sprite_new(\"up.png\")\n if self.direction == \"down\":\n self.attack.sprite = sprite_new(\"down.png\")\n if self.direction == \"left\":\n self.attack.sprite = sprite_new(\"left.png\")\n if self.direction == \"right\":\n self.attack.sprite = sprite_new(\"right.png\")\n\n# Health Stuff\nself.invTimer -= 1\nif game.health <= 0:\n destroy(self)\nif game.health > game.maxHealth:\n game.health = game.maxHealth"}},{"Background":{"type":"object script","start":"#Background start\nself.sprite = sprite_new(\"bgTemp.jpg\")\n","loop":"#Background loop\n\n"}},{"Coin":{"type":"object script","start":"#Coin start\nself.sprite = sprite_new(\"cTemp.png\")\nself.scaleY = 1\nself.scaleX = 1","loop":"#Coin loop\n\n"}},{"Enemy":{"type":"object script","start":"#Enemy start\nself.sprite = sprite_new(\"eTemp.png\")\n\nself.direction = \"right\"\n\n# Health Variables\nself.health = 2\nself.invTimer = 0","loop":"#Enemy loop\nimport random\n\nif self.direction == \"right\":\n self.x = self.x + 2\nif self.direction == \"left\":\n self.x = self.x - 2\nif self.direction == \"up\":\n self.y = self.y + 2\nif self.direction == \"down\":\n self.y = self.y - 2\n\n# Collision\nif collision_check(self, \"Attack\") and self.invTimer < 0:\n self.health -= 1\n self.invTimer = 20\n\n# Health\nself.invTimer -= 1\n\nif self.health <= 0:\n self.lootNum = random.randint(1, 3)\n if self.lootNum == 1:\n self.loot = Coin()\n self.loot.y = self.y\n self.loot.x = self.x\n if self.lootNum == 2:\n self.loot = HealthPickup()\n self.loot.y = self.y\n self.loot.x = self.x\n destroy(self)"}},{"NPC":{"type":"object script","start":"#NPC start\n\nself.sprite = sprite_new(\"npcTemp.png\")\n\nself.myWords = \"null\"","loop":"#NPC loop\n\nif collision_check(self, \"Player\"):\n if key_was_pressed(\"e\"):\n print(self.myWords)"}},{"Attack":{"type":"object script","start":"#Attack start\n\nself.timer = 0.2\n\nself.scaleY = 2\nself.scaleX = 2","loop":"#Attack loop\n\nself.timer -= 1\n\nif self.timer < 0:\n destroy(self)"}},{"HealthPickup":{"type":"object script","start":"#HealthPickup start\n\n","loop":"#HealthPickup loop\n\n"}}],"room":[{"Field":{"type":"room script","start":"# Player\nself.Kyle = Player()\nself.Kyle.y = game.py\nself.Kyle.x = game.px\n\n# Background\nself.bg = Background()\nself.bg.z = -1\n\n# Coins\nself.coin1 = Coin()\nself.coin1.y = 100\nself.coin1.x = 100\n\n# Enemies\nself.enemy1 = Enemy()\nself.enemy2 = Enemy()\nself.enemy2.direction = \"left\"\n\n# NPCs\nself.Peach = NPC()\nself.Peach.y = 200\nself.Peach.x = -300\nself.Peach.myWords = \"Save me hero!\"","loop":"#Field loop\n\nif self.Kyle.x > 600:\n game.py = self.Kyle.y\n game.px = -550\n set_room(\"Forest\")"}},{"Forest":{"type":"room script","start":"#Forest start\n\n# Player\nself.Kyle = Player()\nself.Kyle.y = game.py\nself.Kyle.x = game.px\n\n# Background\nself.bg = Background()\nself.bg.z = -1\n","loop":"#Forest loop\n\nif self.Kyle.x < -600:\n game.py = self.Kyle.y\n game.px = 550\n set_room(\"Field\")"}}],"texture":[{"playerSprite.png":{"type":"image","uri":"https://s3.us-west-1.amazonaws.com/media.pixelpad.io/__PIXELPAD_ASSET__.13804.198900.playerSprite.png"}},{"bgTemp.jpg":{"type":"image","uri":"https://s3.us-west-1.amazonaws.com/media.pixelpad.io/__PIXELPAD_ASSET__.13804.198900.bgTemp.jpg"}},{"cTemp.png":{"type":"image","uri":"https://s3.us-west-1.amazonaws.com/media.pixelpad.io/__PIXELPAD_ASSET__.13804.198900.cTemp.png"}},{"eTemp.png":{"type":"image","uri":"https://s3.us-west-1.amazonaws.com/media.pixelpad.io/__PIXELPAD_ASSET__.13804.198900.eTemp.png"}},{"npcTemp.png":{"type":"image","uri":"https://s3.us-west-1.amazonaws.com/media.pixelpad.io/__PIXELPAD_ASSET__.13804.198900.npcTemp.png"}},{"atemp.png":{"type":"image","uri":"https://s3.us-west-1.amazonaws.com/media.pixelpad.io/__PIXELPAD_ASSET__.13804.198900.atemp.png"}},{"right.png":{"type":"image","uri":"https://s3.us-west-1.amazonaws.com/media.pixelpad.io/__PIXELPAD_ASSET__.13804.198900.right.png"}},{"down.png":{"type":"image","uri":"https://s3.us-west-1.amazonaws.com/media.pixelpad.io/__PIXELPAD_ASSET__.13804.198900.down.png"}},{"left.png":{"type":"image","uri":"https://s3.us-west-1.amazonaws.com/media.pixelpad.io/__PIXELPAD_ASSET__.13804.198900.left.png"}},{"up.png":{"type":"image","uri":"https://s3.us-west-1.amazonaws.com/media.pixelpad.io/__PIXELPAD_ASSET__.13804.198900.up.png"}}],"sound":[],"function":[]}}