Your browser does not support the canvas element.

Clone of Totally not Megaman
2 Plays Last modified: December 19, 2017
0

{"game":{"type":"game script","start":"# Enter the start code for your game here.\n\nimport math\n\n# ———————————————————————-\n# Win Function\n# ———————————————————————-\n\ndef win():\n playing = False\n game.quit_mixins(game.pc)\n destroy(game.pc)\n room_set(‘rm_win’)\n\n# ———————————————————————-\n# Infinite Scrolling Background System\n# ———————————————————————-\n\ndef make_background(sprite_names):\n bg_list = []\n layer_i = 0\n \n for sprite_name in sprite_names:\n bg_layer = []\n bg_list.append(bg_layer)\n bg_sprite = sprite_new(sprite_name)\n \n for i in range(0, 9):\n bg_obj = object_new(‘obj_bg_layer’)\n bg_obj.sprite = bg_sprite\n \n bg_row = game.math.floor(i \/ 3) – 1\n bg_col = i % 3 – 1\n \n bg_obj.x = game.math.floor(bg_col * (object_width(bg_obj) – 1))\n bg_obj.y = game.math.floor(bg_row * (object_height(bg_obj)- 1))\n bg_obj.z = -10 – layer_i\n \n bg_obj.y = 1\n bg_layer.append(bg_obj)\n \n layer_i += 1\n \n return bg_list\n\ndef tick_background(bg_list):\n for bg_layer in bg_list:\n for bg_obj in bg_layer:\n # Loop BG left -> right\n if screen_x(bg_obj.x) + object_width(bg_obj) \/ 2 < -screen_width() \/ 2:\n bg_obj.x += (object_width(bg_obj) – 1) * 3\n # Loop BG right -> left\n if screen_x(bg_obj.x) – object_width(bg_obj) \/ 2 > screen_width() \/ 2:\n bg_obj.x -= (object_width(bg_obj) – 1) * 3\n \n # Loop BG bottom -> top\n if screen_y(bg_obj.y) + object_height(bg_obj) \/ 2 < -screen_height() \/ 2:\n bg_obj.y += (object_height(bg_obj) – 1) * 3\n # Loop BG top -> bottom\n if screen_y(bg_obj.y) – object_height(bg_obj) \/ 2 > screen_height() \/ 2:\n bg_obj.y -= (object_height(bg_obj) – 1) * 3\n\n# ———————————————————————-\n# Mixin System\n# ———————————————————————-\n\n# Adds mixins to obj\ndef init_mixins(obj):\n obj.tick_hooks = []\n \ndef quit_mixins(obj):\n obj.tick_hooks = []\n \n# Call all tick hooks on an object\ndef tick_mixins(obj):\n for i in range(0, len(obj.tick_hooks)):\n obj.tick_hooks[i](obj)\n \n# Add a tick hook to an object – called by mixin init functions\ndef add_tick_hook(obj, tick_hook):\n obj.tick_hooks.append(tick_hook)\n\n# ———————————————————————-\n# Health Mixin\n# ———————————————————————-\n\ndef die(obj):\n playing = False\n game.quit_mixins(obj)\n game.blow_up_block(obj)\n #destroy(obj)\n if obj.type == ‘obj_pc’:\n room_set(‘rm_lose’)\n\ndef take_damage(obj, obj2, amount):\n obj.hp -= amount\n obj.hurt = True\n if obj.hp_obj:\n obj.hp_obj.text.text = \"Health: \" + str(obj.hp)\n if obj.type == ‘obj_pc’:\n pos_dx = obj.x – obj2.x\n #obj.kb_dx = obj.run_speed * game.sign(pos_dx)\n obj.kb_dx = obj.maxspeed * game.sign(pos_dx)\n obj.kb_d = 0.5\n obj.kb_t = 0\n \n #obj.dx = obj.kb_dx\n obj.xspeed = obj.kb_dx\n obj.dy = obj.jump_speed\n\ndef tick_health(obj):\n if obj.hp <= 0:\n game.die(obj)\n\ndef init_health(obj, hp, display):\n obj.hp = hp\n if display:\n obj.hp_obj = object_new(‘obj_health’)\n else:\n obj.hp_obj = None\n game.add_tick_hook(obj, game.tick_health)\n\n# ———————————————————————-\n# Camera Follow Mixin\n# ———————————————————————-\n\ndef camera_follow_y(obj):\n if screen_y(obj.y) < -screen_height() \/ 2 + object_height(obj) \/ 2:\n camera_set(camera_x(), obj.y + screen_height() \/ 2 – object_height(obj) \/ 2)\n returnta\n \n cam_dy = screen_y(obj.y) + obj.overpan[‘y’]\n \n correction = game.tick * obj.correction_speed[‘y’] * cam_dy\n if abs(correction) < 10:\n camera_move(0, cam_dy)\n else:\n camera_move(0, correction * game.tick)\n \ndef camera_follow_x(obj):\n cam_dx = screen_x(obj.x)\n cam_dx += obj.overpan[‘x’]\n\n correction = game.tick * obj.correction_speed[‘x’] * cam_dx\n camera_move(correction * game.tick, 0)\n\ndef tick_camera_follow(obj):\n if obj.on_ground or screen_y(obj.y) < -screen_height() \/ 6:\n game.camera_follow_y(obj)\n game.camera_follow_x(obj)\n \ndef init_camera_follow(obj, correction_speed, overpan):\n camera_set(obj.x, obj.y)\n obj.correction_speed = correction_speed\n obj.overpan = overpan\n game.add_tick_hook(obj, game.tick_camera_follow)\n\n# ———————————————————————-\n# Velocity Mixin\n# ———————————————————————-\n\nMAX_SPEED = 800\n\ndef tick_velocity(obj):\n if obj.dy < -game.MAX_SPEED:\n obj.dy = -game.MAX_SPEED\n obj.x += obj.dx * game.tick\n obj.y += obj.dy * game.tick\n\ndef init_velocity(obj):\n obj.dx = 0\n obj.dy = 0\n game.add_tick_hook(obj, game.tick_velocity)\n \n# ———————————————————————-\n# Gravity Mixin\n# ———————————————————————-\n\nGRAVITY_ACCELERATION = -2400\n\ndef tick_gravity(obj):\n if obj.gravity:\n obj.dy += game.GRAVITY_ACCELERATION * game.tick\n \ndef init_gravity(obj):\n obj.gravity = True\n game.add_tick_hook(obj, game.tick_gravity)\n\n# ———————————————————————- \n# Input Mixin\n# ———————————————————————-\n# Changed the way this works because \n# too complicated for me to understand\n\ndef tick_input(obj): \n #maxspeed and minspeed\n obj.maxspeed = 3\n obj.minspeed = 0.5\n obj.friction = 0.25\n obj.left_key = \"left\"\n obj.right_key = \"right\"\n obj.accel = 1\n \n #only limit speed when on ground\n if obj.on_ground:\n #friction\n if obj.xspeed > 0:\n obj.xspeed -= obj.friction\n else:\n if obj.xspeed < 0:\n obj.xspeed += obj.friction\n \n #max speed\n if obj.xspeed > maxspeed:\n obj.xspeed = maxspeed-1\n else:\n if obj.xspeed < -maxspeed:\n obj.xspeed = -maxspeed+1\n \n if obj.on_ground:\n if key_is_pressed(obj.left_key):\n obj.xspeed -= obj.accel\n obj.facing = -1\n if key_is_pressed(obj.right_key):\n obj.xspeed += obj.accel\n obj.facing = 1\n \n if key_was_pressed(‘down’):\n if obj.slide_timer <= 0:\n obj.slide_timer = 20\n \n if obj.on_ground or obj.slide_timer > 0:\n if key_was_pressed(‘space’):\n obj.dy = obj.jump_speed\n obj.on_ground = False\n obj.shooting = False\n if obj.slide_timer > 0:\n obj.slide_timer = 1\n \n #if sliding make him go faster than maxspeed \n if obj.slide_timer > 0:\n obj.slide_timer -=1\n obj.xspeed = obj.maxspeed * 2 * obj.facing\n \n if not obj.on_ground and not obj.hurt:\n if key_is_pressed(obj.left_key):\n if obj.xspeed > -obj.maxspeed:\n obj.xspeed -= obj.accel \/10\n if key_is_pressed(obj.right_key):\n if obj.xspeed < obj.maxspeed:\n obj.xspeed += obj.accel \/10\n \n if abs(obj.xspeed) > obj.minspeed:\n obj.x += obj.xspeed\n #print(xspeed)\n else:\n if obj.on_ground:\n obj.xspeed = 0\n \n if key_is_pressed(‘z’) and not obj.hurt and not obj.charging:\n obj.charging = True\n obj.obj_charge = object_new(\"obj_charging\")\n obj.obj_charge.parent = obj\n \n if (obj.charging and not key_is_pressed(‘z’) or obj.charging and obj.hurt):\n obj.charging = False\n if obj.obj_charge.powered_up >= 1:\n object_destroy(obj.obj_charge.powerup_effect)\n object_destroy(obj.obj_charge)\n if obj.obj_charge.charge_power > 5:\n obj.should_shoot = True\n obj.shooting = True\n obj.shooting_timer = 30\n \n if key_was_pressed(‘z’) and obj.slide_timer <= 0:\n obj.should_shoot = True\n obj.shooting = True\n obj.shooting_timer = 30\n \n if obj.shooting_timer > 0:\n obj.shooting_timer -=1\n else:\n obj.shooting = False\n\n #if abs(obj.xspeed) > 0 and not obj.hurt:\n # obj.facing = game.sign(obj.xspeed)\n \n if obj.facing == -1:\n obj.sprite_xscale = -1\n else:\n obj.sprite_xscale = 1\n \ndef init_input(obj, run_speed, jump_height):\n obj.facing = 1\n obj.run_speed = run_speed\n obj.jump_speed = game.math.sqrt(2 * -game.GRAVITY_ACCELERATION * jump_height)\n game.add_tick_hook(obj, game.tick_input)\n obj.slide_timer = -1\n obj.xspeed = 0\n obj.yspeed = 0\n \n# ———————————————————————- \n# Shooting Mixin\n# ———————————————————————-\n\ndef shoot_from(obj):\n if len(obj.active_shots) >= obj.max_shots:\n return\n \n shot = object_new(‘obj_basic_shot’)\n shot.x = obj.x + obj.facing * (object_width(obj) \/ 2 + 2)\n shot.y = obj.y\n shot.direction = obj.facing\n shot.ignore.append(obj.type)\n shot.ignore.append(‘obj_charging_2’)\n shot.ignore.append(‘obj_pc_afterimage’)\n shot.ignore.append(‘obj_dst_block’)\n shot.ignore.append(‘obj_special_effect’)\n shot.ignore.append(‘obj_nrm_block’)\n shot.ignore.append(‘obj_charging’)\n shot.ignore.append(‘obj_bg_layer’)\n shot.ignore.append(‘obj_health’)\n shot.ignore.append(‘obj_generictext’)\n shot.ignore.append(‘obj_win_zone’)\n shot.parent = obj\n obj.active_shots.append(shot)\n shot.direction = obj.facing\n shot.shot_type = shot.parent.shot_type\n\ndef tick_shooting(obj):\n if obj.should_shoot:\n game.shoot_from(obj)\n obj.should_shoot = False\n \ndef init_shooting(obj, max_shots):\n obj.active_shots = []\n obj.max_shots = max_shots\n obj.shot_type = \"\"\n game.add_tick_hook(obj, game.tick_shooting)\n \n# ———————————————————————-\n# Collision Mixin\n# ———————————————————————-\n\ndef handle_solid_collisions(obj):\n obj.on_ground = False\n skin_size = 2\n \n for solid_type in obj.solids:\n for obj2 in collision_check_skin_all(obj, solid_type, skin_size, skin_size):\n mpv = game.mpv(obj, obj2, skin_size, skin_size)\n \n # Vertical collision\n if abs(mpv[‘y’]) > 0:\n xpen = game.xpen(obj, obj2, skin_size, skin_size)\n \n # Need a minimum X penetration before handling, so that we can’t land or\n # bump our head on the edges of walls\n if xpen < 5:\n pass\n \n # Handle landing\n elif mpv[‘y’] < 0:\n if obj.dy < 0:\n obj.dy = 0\n obj.on_ground = True\n obj.y = obj2.y + (object_height(obj2) \/ 2 + object_height(obj) \/ 2)\n \n # Handle bonking off the ceiling\n else:\n obj.y = obj2.y – (object_height(obj2) \/ 2 + object_height(obj) \/ 2)\n \n # Horizontal collision\n elif abs(mpv[‘x’]) > 0:\n ypen = game.ypen(obj, obj2, skin_size, skin_size)\n \n # Need a minimum Y penetration before handling, so that we don’t get shoved\n # to the side when we land or bonk our head\n if ypen < 5:\n pass\n \n # Handle OBJ2 <- OBJ\n elif mpv[‘x’] < 0:\n obj.x = obj2.x + (object_width(obj2) \/ 2 + object_width(obj) \/ 2)\n \n # Handle OBJ -> OBJ2\n else:\n obj.x = obj2.x – (object_width(obj2) \/ 2 + object_width(obj) \/ 2)\n\n \ndef handle_enemy_collisions(obj):\n if obj.kb_t < obj.kb_d:\n obj.hurt = True\n obj.kb_t += game.tick\n #obj.dx = obj.kb_dx\n #obj.xspeed = obj.kb_dx \/ 1000\n \n else:\n obj.hurt = False\n for enemy_type in obj.enemies:\n for obj2 in collision_check_all(obj, enemy_type):\n game.take_damage(obj, obj2, 1)\n\ndef tick_collisions(obj):\n game.handle_solid_collisions(obj)\n game.handle_enemy_collisions(obj)\n\ndef init_collisions(obj, solids, enemies):\n obj.solids = solids\n obj.enemies = enemies\n obj.on_ground = False\n obj.hurt = False\n obj.kb_t = 0\n obj.kb_d = 0\n game.add_tick_hook(obj, game.tick_collisions)\n\n# ———————————————————————-\n# Utilities\n# ———————————————————————-\n\n# Compute the X Penetration (xpen) of two objects using the Minkowski Difference\ndef xpen(obj, obj2, skin_width, skin_height):\n md = game.minkowski(obj, obj2, skin_width, skin_height)\n \n if abs(md[‘L’]) < abs(md[‘R’]):\n return abs(md[‘L’])\n else:\n return abs(md[‘R’])\n \ndef ypen(obj, obj2, skin_width, skin_height):\n md = game.minkowski(obj, obj2, skin_width, skin_height)\n \n if abs(md[‘B’]) < abs(md[‘T’]):\n return abs(md[‘B’])\n else:\n return abs(md[‘T’])\n\n# Compute the Minimum Penetration Vector (MPV) of two objects relative to the first object\n# Basically, subtract the MPV from the first object’s position, and the two objects will\n# no longer be overlapping\n# Assumes objects are colliding, results won’t make sense if not\ndef mpv(obj1, obj2, skin_width, skin_height):\n md = game.minkowski(obj1, obj2, skin_width, skin_height)\n \n if abs(md[‘L’]) < abs(md[‘R’]):\n min_x = md[‘L’]\n else:\n min_x = md[‘R’]\n \n if abs(md[‘B’]) < abs(md[‘T’]):\n min_y = md[‘B’]\n else:\n min_y = md[‘T’]\n \n if abs(min_x) < abs(min_y):\n return {‘x’: min_x, ‘y’: 0}\n else:\n return {‘x’: 0, ‘y’: min_y}\n \n# Computes the Minkowski difference of two objects’ AABBs\n# Returns a new AABB. If the AABB contains (0, 0), the objects are colliding\n# Smallest distance between (0, 0) and an edge is MPV (see mpv function above)\ndef minkowski(obj1, obj2, skin_width, skin_height):\n W1 = object_width(obj1) + skin_width\n W2 = object_width(obj2) + skin_width\n \n H1 = object_height(obj1) + skin_height\n H2 = object_height(obj2) + skin_height\n\n L1 = obj1.x – W1 \/ 2\n R2 = obj2.x + W2 \/ 2\n L = L1 – R2\n \n B1 = obj1.y – H1 \/ 2\n T2 = obj2.y + H2 \/ 2\n B = B1 – T2\n \n W = W1 + W2\n H = H1 + H2\n \n R = L + W\n T = B + H\n \n return {‘L’: L, ‘T’: T, ‘R’: R, ‘B’: B}\n \n# Sign Function\n# Returns +1 if x is positive or 0, -1 if x is negative\ndef sign(x):\n if x >= 0:\n return 1\n else:\n return -1\n\ndef blow_up_block(obj):\n #blow up block\n q = []\n for i in range(4):\n q.append(object_new(\"obj_dst_block\"))\n q[i].z = 10\n q[i].sprite_width = 0.33\n q[i].sprite_height = 0.33\n q[i].fall = True\n\n q[0].x = obj.x – object_width(obj) \/ 4\n q[0].y = obj.y + object_height(obj) \/ 4\n q[0].xspeed = -4\n q[0].yspeed = 20\n q[1].x = obj.x + object_width(obj) \/ 4\n q[1].y = obj.y – object_height(obj) \/ 4\n q[1].xspeed = 4\n q[1].yspeed = 20\n q[2].x = obj.x + object_width(obj) \/ 4\n q[2].y = obj.y + object_height(obj) \/ 4\n q[2].xspeed = 3\n q[2].yspeed = 10\n q[3].x = obj.x – object_width(obj) \/ 4\n q[3].y = obj.y – object_height(obj) \/ 4\n q[3].xspeed = -3\n q[3].yspeed = 10\n \n object_destroy(obj)\n\n \n \n\n# ———————————————————————-\n# Start Game\n# ———————————————————————-\n\nroom_set(\"rm_title\")\nplaytime = 0\nplaying = True","loop":"# Enter the loop code for your game here.\n\nif playing:\n playtime += game.tick"},"rm_level_01":{"type":"room script","start":"# Enter the start code for rm_level_01 here.\n\n# Mapping Primitives\n\nBLOCK_SIZE = 32\n\nspawn_x = 0\nspawn_y = 0\n\ndef move_horz(dx):\n spawn_x += dx * BLOCK_SIZE\n\ndef move_vert(dy):\n spawn_y += dy * BLOCK_SIZE\n\ndef blocks_horz(count):\n result = []\n dir = game.sign(count)\n \n for i in range(abs(count)):\n b = object_new(‘obj_nrm_block’)\n result.append(b)\n \n b.x = spawn_x + i * BLOCK_SIZE * dir\n b.y = spawn_y\n \n move_horz(count)\n return result\n \ndef blocks_vert(count):\n result = []\n dir = game.sign(count)\n \n for i in range(abs(count)):\n b = object_new(‘obj_nrm_block’)\n result.append(b)\n \n b.x = spawn_x\n b.y = spawn_y + i * BLOCK_SIZE * dir\n \n move_vert(count)\n return result\n \ndef enemy_gnd(rel_x, rel_y, patrol_L, patrol_R):\n e = object_new(‘obj_gnd_enemy’)\n e.x = spawn_x + rel_x * BLOCK_SIZE\n e.y = spawn_y + rel_y * BLOCK_SIZE\n e.patrol_L = spawn_x + (rel_x + patrol_L) * BLOCK_SIZE\n e.patrol_R = spawn_x + (rel_x + patrol_R) * BLOCK_SIZE\n return e\n \ndef win_zone(rel_x, rel_y):\n z = object_new(‘obj_win_zone’)\n z.x = spawn_x + rel_x * BLOCK_SIZE\n z.y = spawn_y + rel_y * BLOCK_SIZE\n return z\n \n# Major Sections\ndef section_00():\n blocks_horz(10)\n\ndef section_01():\n blocks_vert(-3)\n blocks_horz(30)\n enemy_gnd(-3, 1, -2, 2)\n blocks_horz(15)\n move_horz(2)\n blocks_horz(5)\n move_horz(2)\n blocks_horz(5)\n enemy_gnd(-3, 1, -2, 2)\n move_horz(2)\n blocks_horz(5)\n move_horz(2)\n blocks_horz(5)\n move_horz(2)\n blocks_horz(20)\n enemy_gnd(-3, 1, -2, 2)\n\n \ndef section_two_sided_stairs_normal():\n move_horz(-10)\n move_vert(2)\n blocks_horz(4)\n move_vert(2)\n move_horz(2)\n blocks_horz(4)\n enemy_gnd(-2, 1, -2, 1)\n \ndef section_two_sided_stairs_dash():\n move_horz(-9)\n move_vert(1)\n blocks_horz(4)\n move_vert(1)\n move_horz(2)\n blocks_horz(4)\n \ndef section_02():\n blocks_horz(2) \n blocks_vert(-1) \n blocks_horz(1) \n blocks_vert(-1) \n blocks_horz(5) \n blocks_vert(1) \n blocks_horz(2) \n blocks_vert(-1) \n blocks_horz(1) \n blocks_vert(-1) \n blocks_horz(1) \n blocks_vert(-3)\n blocks_horz(4)\n move_horz(3) \n blocks_horz(1) \n move_horz(2) \n blocks_horz(2) \n blocks_vert(1)\n blocks_horz(1)\n blocks_vert(1) \n blocks_horz(2)\n move_horz(4)\n \ndef section_gaps():\n blocks_vert(-2) \n blocks_horz(10)\n enemy_gnd(-3, 1, -2, 2)\n enemy_gnd(-5, 1, -2, 3)\n blocks_vert(2)\n blocks_horz(2)\n blocks_vert(-3)\n blocks_horz(4)\n move_horz(2) \n blocks_horz(1)\n move_horz(2)\n blocks_horz(1)\n move_horz(2)\n blocks_horz(1)\n move_horz(2)\n blocks_horz(1)\n move_horz(2)\n blocks_horz(4)\n blocks_vert(2) \n blocks_horz(2)\n blocks_vert(-4)\n blocks_horz(20) \n enemy_gnd(-15, 1, -4, 4)\n enemy_gnd(-5, 1, -2, 3)\n \ndef section_03():\n blocks_vert(-10)\n blocks_horz(5)\n move_vert(4)\n blocks_horz(10)\n move_horz(-10)\n move_vert(-4)\n move_horz(2)\n blocks_horz(3)\n move_horz(2)\n blocks_horz(3)\n move_horz(2)\n blocks_horz(2)\n enemy_gnd(-1, 1, 0, 0)\n blocks_vert(2)\n blocks_horz(2)\n blocks_vert(2)\n\ndef section_long_jump():\n blocks_horz(10)\n move_horz(6)\n blocks_horz(5)\n enemy_gnd(-3, 1, -2, 3)\n\ndef section_04():\n move_horz(2)\n blocks_horz(1)\n move_horz(2)\n blocks_vert(3)\n enemy_gnd(0, 0, 0, 0)\n move_horz(3)\n move_vert(-2)\n blocks_horz(1)\n move_horz(2)\n blocks_vert(3)\n enemy_gnd(0, 0, 0, 0)\n move_horz(3)\n move_vert(-2)\n blocks_horz(1)\n move_horz(2)\n blocks_vert(2)\n enemy_gnd(0, 0, 0, 0)\n move_horz(2)\n blocks_vert(1)\n move_horz(2)\n blocks_vert(1)\n move_horz(3)\n blocks_vert(2)\n move_horz(2)\n move_vert(1)\n blocks_horz(20)\n \ndef section_05():\n move_horz(2)\n blocks_horz(1)\n move_horz(2)\n blocks_vert(2)\n enemy_gnd(0, 0, 0, 0)\n move_horz(3)\n move_vert(-2)\n blocks_horz(1)\n move_horz(2)\n blocks_vert(2)\n enemy_gnd(0, 0, 0, 0)\n move_horz(3)\n move_vert(-2)\n blocks_horz(1)\n move_horz(2)\n blocks_vert(2)\n enemy_gnd(0, 0, 0, 0)\n move_horz(2)\n blocks_vert(1)\n move_horz(2)\n blocks_vert(1)\n move_horz(3)\n blocks_vert(2)\n move_horz(2)\n move_vert(1)\n blocks_horz(20)\n \n win_zone(-1, 1)\n\npc = object_new(‘obj_pc’)\nbg = game.make_background([‘spr_bg_city’])\n\ngame.pc = pc\n\nmove_vert(-4)\nmove_horz(-4)\nblocks_vert(19)\nmove_vert(-20)\n\nsection_00()\nsection_01()\nsection_gaps()\nsection_two_sided_stairs_normal()\nsection_two_sided_stairs_normal()\nsection_two_sided_stairs_normal()\nsection_two_sided_stairs_normal()\nsection_03()\nsection_02()\nsection_long_jump()\nsection_long_jump()\nsection_long_jump()\nsection_04()\nsection_01()\nsection_02()\nsection_05()\n\n#bgm = sound_new(‘snd_bgm’)\n#sound_volume(10)\n#sound_loop(bgm)","loop":"# Enter the loop code for rm_level_01 here.\n\ngame.tick_background(bg)\n\nif game.pc.y <= -400:\n game.die(game.pc)"},"obj_pc":{"type":"object script","start":"# Enter the start code for obj_pc here.\n\ngame.init_mixins(self)\n\ngame.init_gravity(self)\ngame.init_input(self, 120, 80)\ngame.init_shooting(self, 1000)\ngame.init_collisions(self, [‘obj_nrm_block’], [‘obj_gnd_enemy’])\ngame.init_velocity(self)\ngame.init_camera_follow(self, {‘x’:200, ‘y’:200}, {‘x’:100,’y’:100})\ngame.init_health(self, 10, True)\n\nstand_sprite = sprite_new(‘spr_mmx_stand’, 1, 4)\nanim_stand = animation_new(stand_sprite, 1, 0, 3)\n\njump_sprite = sprite_new(‘spr_mmx_jump’, 1, 2)\nanim_jump_up = animation_new(jump_sprite, 0, 0, 0)\nanim_jump_down = animation_new(jump_sprite, 0, 1, 1)\n\nhurt_sprite = sprite_new(‘spr_mmx_hurt’, 1, 4)\nanim_hurt = animation_new(hurt_sprite, 15, 0, 3)\n\nwalk_sheet = sprite_new(‘spr_mmx_run’, 1, 6)\nanim_walk = animation_new(walk_sheet, 11, 0, 5)\n\nshoot_sheet = sprite_new(‘spr_mmx_shoot’, 1, 6)\nanim_shoot = animation_new(shoot_sheet, 11, 0, 5)\n\nslide_sheet = sprite_new(‘spr_mmx_dash’, 1, 1)\nanim_slide = animation_new(slide_sheet, 0, 0, 0)\n\njump_shoot_sheet = sprite_new(‘spr_mmx_jump_shoot’, 1, 2)\nanim_jump_shoot_up = animation_new(jump_shoot_sheet, 0,0,0)\nanim_jump_shoot_down = animation_new(jump_shoot_sheet, 0,1,1)\n\nsprite_width = 0.4#48 \/ 72\nsprite_height = 0.4#48 \/ 97\n\nanimation_set(self, anim_stand)\n\ncurrent_anim = \"\"\nshot_type = \"spr_mm_hadouken_blue\"\n\nssj_0 = 3 #when charging\nssj_1 = 15#double\nssj_2 = 60#ssj\nssj_3 = 90#energyball\nssj_4 = 105\nssj_5 = 140\nssj_6 = 200\n\ncurrent_animation = \"\"\n\ndef jump_hack():\n #jump to ground animation hack\n if cur_anim == \"anim_jump_shoot\" or cur_anim == \"anim_jump\":\n self.y -= 18\n #jump to ground animation hack\n \ndef anim_set(s, a):\n animation_set(s, a)\n current_animation = a\n \nafter_image_count = 0\n","loop":"# Enter the loop code for obj_pc here.\n\ngame.tick_mixins(self)\n\nif hurt:\n anim_set(self, anim_hurt)\nelse:\n if shooting:\n if on_ground:\n jump_hack()\n anim_set(self, anim_shoot)\n cur_anim = \"anim_shoot\"\n if slide_timer > 0:\n shooting = False\n else:\n if not cur_anim == \"anim_shoot\":\n if dy > 0:\n anim_set(self, anim_jump_shoot_up)\n else:\n anim_set(self, anim_jump_shoot_down)\n cur_anim = \"anim_jump_shoot\"\n \n else:\n if charging and on_ground:\n jump_hack()\n if charging and slide_timer <= 0:\n if on_ground:\n anim_set(self, anim_shoot)\n cur_anim = \"anim_shoot\"\n else:\n if on_ground:\n jump_hack()\n if slide_timer > 0:\n cur_anim = \"anim_slide\"\n anim_set(self, anim_slide)\n else:\n if abs(xspeed) > 0 and (key_is_pressed(left_key) or key_is_pressed(right_key)):\n cur_anim = \"anim_walk\"\n anim_set(self, anim_walk)\n else:\n cur_anim = \"anim_stand\"\n anim_set(self, anim_stand)\n else:\n if abs(dy) > 350:\n if dy > 0:\n anim_set(self, anim_jump_up)\n else:\n anim_set(self, anim_jump_down)\n cur_anim = \"anim_jump\"\n if charging and not on_ground:\n if abs(dy) > 350:\n if dy > 0:\n anim_set(self, anim_jump_up)\n else:\n anim_set(self, anim_jump_down)\n cur_anim = \"anim_jump\"\n\n#after image\nafter_image_count +=1\nif abs(self.xspeed) > abs(self.maxspeed) + 1:\n if after_image_count % 3 == 0:\n after_image = object_new(\"obj_pc_afterimage\")\n after_image.x = self.x\n after_image.y = self.y\n after_image.sprite_xscale = self.facing\n after_image.sprite_width = self.sprite_width\n after_image.sprite_height = self.sprite_height\n animation_set(after_image, current_animation)\n"},"obj_nrm_block":{"type":"object script","start":"# Enter the start code for obj_nrm_block here.\n\nsprite = sprite_new(\"spr_grassy_tile\")\nsprite_width = 0.5\nsprite_height =0.5\n","loop":"# Enter the loop code for obj_nrm_block here.\n\n#if collision_check(self, \"obj_basic_shot\"):\n# game.blow_up_block(self)"},"spr_tiles":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_tiles.png"},"obj_bg_layer":{"type":"object script","start":"# Enter the start code for obj_bg_layer here.","loop":"# Enter the loop code for obj_bg_layer here."},"obj_gnd_enemy":{"type":"object script","start":"# Enter the start code for obj_gnd_enemy here.\n\nimport random\n\ngame.init_mixins(self)\ngame.init_shooting(self, 1)\ngame.init_health(self, 3, False)\n\nfacing = -1\nspeed = 75\n\nsprite = sprite_new(‘spr_snail’)\n\n\nfacing_player = False\ntime_since_last_shot = 0\nshot_delay = 0.4\n\nstopped = False\ntime_since_last_stop = 0\nnext_stop = random.randrange(4, 10)\nstop_duration = 1","loop":"# Enter the loop code for obj_gnd_enemy here.\n\nif not facing_player and not stopped:\n x += speed * facing * game.tick\n if x <= patrol_L:\n x = patrol_L + 1\n facing = 1\n sprite_xscale = -1\n if x >= patrol_R:\n x = patrol_R – 1\n facing = -1\n sprite_xscale = 1\n\nplayer_dx = game.pc.x – self.x\nplayer_dy = game.pc.y – self.y\n\nif player_dx * facing > 0:\n facing_player = abs(player_dx) < 200\nelse:\n facing_player = False\n \nif facing_player:\n time_since_last_shot += game.tick\n if time_since_last_shot > shot_delay:\n should_shoot = True\n time_since_last_shot = 0\nelse:\n time_since_last_shot = 0\n\nif stopped:\n time_stopped += game.tick\n if time_stopped >= stop_duration:\n stopped = False\n time_since_last_stop = 0\nelse:\n time_since_last_stop += game.tick\n if time_since_last_stop >= next_stop:\n stopped = True\n time_stopped = 0\n next_stop = random.randrange(4, 10)\n \ngame.tick_mixins(self)"},"obj_basic_shot":{"type":"object script","start":"# Enter the start code for obj_basic_shot here.\n\n\n#sprite.cell = 3\nsprite = sprite_new(\"spr_tiles\", 2, 2)\nsprite_width = 0.1\nsprite_height = 0.1\nsprite_rotation = 0\n\nalive = 0\nmax_alive = 100\n\nignore = [self.type]\ndx = 800\n\ninit_loop = True\nshot_damage = 1","loop":"# Enter the loop code for obj_basic_shot here.\n\nif init_loop:\n if not shot_type == \"\":\n sprite_xscale = parent.facing\n init_loop = False\n sprite_width = 1\n sprite_height = 1\n y += 10\n fireball_sheet = sprite_new(\"spr_mm_hadouken_blue\", 1, 3)\n animation_set(self, animation_new(fireball_sheet, 30, 0, 2))\n \n if parent.obj_charge.charge_power > parent.ssj_1:\n sprite_width = 1.25\n sprite_height = 1.25\n shot_damage = 2\n fireball_sheet = sprite_new(\"spr_mm_hadouken_green\", 1, 3)\n animation_set(self, animation_new(fireball_sheet, 30, 0, 2))\n if parent.obj_charge.charge_power > parent.ssj_2:\n sprite_width = 1.5\n sprite_height = 1.5\n shot_damage = 3\n fireball_sheet = sprite_new(\"spr_mm_hadouken_red\", 1, 3)\n animation_set(self, animation_new(fireball_sheet, 30, 0, 2))\n \n if parent.obj_charge.charge_power > parent.ssj_3:\n sprite_width = parent.obj_charge.powerup_effect.sprite_width\n sprite_height = parent.obj_charge.powerup_effect.sprite_height\n shot_damage = 1\n fireball_sheet = sprite_new(\"spr_mmx_ssj_2\", 1, 20)\n animation_set(self, animation_new(fireball_sheet, 60, 0, 19))\n \n if parent.obj_charge.charge_power > parent.ssj_4:\n shot_damage = 2\n fireball_sheet = sprite_new(\"spr_mmx_ssj_2\", 1, 20)\n animation_set(self, animation_new(fireball_sheet, 60, 0, 19))\n \n if parent.obj_charge.charge_power > parent.ssj_5:\n shot_damage = 3\n fireball_sheet = sprite_new(\"spr_mmx_ssj_2\", 1, 20)\n animation_set(self, animation_new(fireball_sheet, 60, 0, 19))\n \n if parent.obj_charge.charge_power > parent.ssj_6:\n shot_damage = 3\n fireball_sheet = sprite_new(\"spr_mmx_ssj_2\", 1, 20)\n animation_set(self, animation_new(fireball_sheet, 60, 0, 19)) \n \n else:\n sprite = sprite_new(‘spr_tiles’, 2, 2)\n sprite_width = 0.2\n sprite_height = 0.2\n sprite.cell = 3\n\nx += dx * direction * game.tick\n\n# If farther than 1 screen width from camera, self destruct\nif abs(screen_x(x)) >= screen_width():\n destroy(self)\n parent.active_shots.remove(self)\n \nalive += game.tick\n\n# If lasted longer than max lifespan, self destruct\nif alive >= max_alive:\n destroy(self)\n parent.active_shots.remove(self)\n \n# If colliding with anything not in ignore list, destroy self\nany_colls = False\nfor obj in collision_check_all(self):\n if obj == self:\n continue\n \n if self.ignore.index(obj.type) < 0:\n game.take_damage(obj, self, shot_damage)\n if parent.type == \"obj_pc\":\n if parent.obj_charge.charge_power > parent.ssj_4:\n pass\n else:\n any_colls = True\n else:\n any_colls = True\n \nif any_colls:\n destroy(self)\n parent.active_shots.remove(self)\n \nif shot_type == \"\":\n sprite_rotation += 720 * game.tick * direction"},"obj_health":{"type":"object script","start":"# Enter the start code for obj_health here.\n\ntext = text_new(‘sans-serif’, 16)\ntext.text = ‘Health: 10’\nz = 1000","loop":"# Enter the loop code for obj_health here.\n\nx = camera_x() – (screen_width() \/ 4 + 50)\ny = camera_y() + (screen_height() \/ 4 + 80)"},"rm_lose":{"type":"room script","start":"# Enter the start code for rm_lose here.\n\nyoulose = object_new(‘obj_generictext’)\nyoulose.text.text = ‘Nice Try =)’\nyoulose.text.size = 48\nyoulose.y = 180\nyoulose.sprite_color = ‘#64d464’\n\ntryagain = object_new(‘obj_generictext’)\ntryagain.text.text = ‘Press [Z] to try again’\ntryagain.text.size = 24\ntryagain.y = -180\ntryagain.sprite_color = ‘#d46464’","loop":"# Enter the loop code for rm_lose here.\n\nif key_is_pressed(‘z’):\n game.playing = True\n game.playtime = 0\n room_set(‘rm_level_01’)"},"obj_generictext":{"type":"object script","start":"# Enter the start code for obj_generictext here.\n\ntext = text_new(‘sans-serif’, 16)","loop":"# Enter the loop code for obj_generictext here."},"rm_win":{"type":"room script","start":"# Enter the start code for rm_win here.\n\nimport math\n\nyouwin = object_new(‘obj_generictext’)\nyouwin.text.text = ‘You Win!’\nyouwin.text.size = 48\nyouwin.y = 180\nyouwin.sprite_color = ‘#64d464’\n\nplaytime = object_new(‘obj_generictext’)\nplaytime.text.text = ‘You reached the end in\\n’ + math.floor(game.playtime * 100) \/ 100 + ‘\\nseconds!’\nplaytime.text.size = 32\n\ntryagain = object_new(‘obj_generictext’)\ntryagain.text.text = ‘Press [Z] to play again’\ntryagain.text.size = 24\ntryagain.y = -180\ntryagain.sprite_color = ‘#d46464’","loop":"# Enter the loop code for rm_win here.\n\nif key_is_pressed(‘z’):\n game.playing = True\n game.playtime = 0\n room_set(‘rm_level_01’)"},"obj_win_zone":{"type":"object script","start":"# Enter the start code for obj_win_zone here.\n\nsprite = sprite_new_box(32, 32)\n\nsprite_color = ‘white’","loop":"# Enter the loop code for obj_win_zone here.\n\nif collision_check(self, ‘obj_pc’):\n game.win()\n \nsprite_rotation += 360 * game.tick"},"snd_bgm":{"type":"audio","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/snd_bgm.dat"},"spr_snail":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_snail.png"},"rm_title":{"type":"room script","start":"# Enter the start code for rm_title here.\n\ngametitle = object_new(‘obj_generictext’)\ngametitle.text.text = ‘Game Name’\ngametitle.text.size = 48\ngametitle.y = 180\ngametitle.sprite_color = ‘#64d464’\n\nplaytime = object_new(‘obj_generictext’)\nplaytime.text.text = ‘Controls:\\n\\n[Space] = Jump\\n[Z] = Shoot\\n[Down] = Dash \\n\\nGet to the end!’\nplaytime.text.size = 32\n\nstart = object_new(‘obj_generictext’)\nstart.text.text = ‘Press [Z] to play’\nstart.text.size = 24\nstart.y = -180\nstart.sprite_color = ‘#d46464’","loop":"# Enter the loop code for rm_title here.\n\nif key_is_pressed(‘z’):\n game.playing = True\n game.playtime = 0\n room_set(‘rm_level_01’)"},"spr_grassy_tile":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_grassy_tile.jpeg"},"spr_bg_city":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_bg_city.jpeg"},"spr_mm_slide":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mm_slide.png"},"spr_mm_hadouken_green":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mm_hadouken_green.png"},"spr_mm_hadouken_blue":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mm_hadouken_blue.png"},"spr_mm_hadouken_red":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mm_hadouken_red.png"},"spr_mm_hadouken_yellow":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mm_hadouken_yellow.png"},"spr_mmx_stand":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mmx_stand.png"},"spr_mmx_shoot":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mmx_shoot.png"},"spr_mmx_hurt":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mmx_hurt.png"},"spr_mmx_dash":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mmx_dash.png"},"spr_mmx_run":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mmx_run.png"},"spr_mmx_jump":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mmx_jump.png"},"spr_mmx_jump_shoot":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mmx_jump_shoot.png"},"spr_mmx_charge":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mmx_charge.png"},"obj_charging":{"type":"object script","start":"# Enter the start code for obj_charging here.\n\ny = -100000\npowered_up = 0\ncharge_power = 0\n\ncharge_sheet = sprite_new(\"spr_mmx_charge\", 1,9)\nanim_charge = animation_new(charge_sheet, 30,0,8)\nanimation_set(self, anim_charge)\n\nssj_elec = sprite_new(\"spr_mmx_ssj_2\", 1,20)\nanim_ssj_elec = animation_new(ssj_elec, 30,0,19)\n\nssj_blue = sprite_new(\"spr_mmx_ssj_aura_blue\", 1,4)\nanim_ssj_blue = animation_new(ssj_blue, 30,0,3)\n\nssj_red = sprite_new(\"spr_mmx_ssj_aura_red\", 1,4)\nanim_ssj_red = animation_new(ssj_red, 30,0,3)\n\nssj_yellow = sprite_new(\"spr_mmx_ssj_aura_yellow\", 1,4)\nanim_ssj_yellow = animation_new(ssj_yellow, 30,0,3)\n\nssj_black = sprite_new(\"spr_mmx_ssj_aura_black\", 1,4)\nanim_ssj_black = animation_new(ssj_black, 30,0,3)\n\nboom_sheet = sprite_new(‘spr_mmx_ssj_flash’, 1, 12)\nboom_anim = animation_new(boom_sheet, 30, 0, 11)\n\nboom_sheet2 = sprite_new(‘spr_mmx_ssj_flash2’, 1, 30)\nboom_anim2 = animation_new(boom_sheet2, 60, 0, 29)\n\n","loop":"# Enter the loop code for obj_charging here.\n#looks like i did some wierd coding practices here…\n#i have 3 effects, charging, special and ssj\n#initially, i wanted it to do 3 unique things\n#it ended up being a jumbled mess here. mayb later\n#i can fix it up. but for now, it’s simple enough where\n#i can leave it as it is\n\n\nif charge_power >= parent.ssj_1:\n if powered_up == 0:\n powerup_effect = object_new(\"obj_charging_2\")\n animation_set(powerup_effect, anim_charge)\n powered_up = 1\n \nif charge_power >= parent.ssj_2:\n if powered_up == 1:\n boom = object_new(\"obj_special_effect\")\n boom.parent = self.parent\n animation_set(boom, boom_anim2)\n \n animation_set(self, anim_ssj_red)\n sprite_width = 0.6\n sprite_height = 0.6\n powered_up = 2\n\nif charge_power >= parent.ssj_3:\n if powered_up == 2:\n boom = object_new(\"obj_special_effect\")\n boom.parent = self.parent\n animation_set(boom, boom_anim2)\n \n animation_set(self, anim_ssj_blue)\n animation_set(powerup_effect, anim_ssj_elec)\n powerup_effect.sprite_width = 0.25\n powerup_effect.sprite_height = 0.25\n powered_up = 3\n\nif charge_power >= parent.ssj_4:\n if powered_up == 3:\n powerup_effect.sprite_width = 1\n powerup_effect.sprite_height = 1\n powered_up = 4\n \nif charge_power >= parent.ssj_5:\n if powered_up == 4:\n powerup_effect.sprite_width = 2\n powerup_effect.sprite_height = 2\n powered_up = 5\n \nif charge_power >= parent.ssj_6:\n if powered_up == 5:\n boom = object_new(\"obj_special_effect\")\n boom.parent = self.parent\n animation_set(boom, boom_anim)\n \n #animation_set(self, anim_ssj_black)\n powerup_effect.sprite_width = 3\n powerup_effect.sprite_height = 3\n powered_up = 6\n# where to place the animation\n\nif charge_power >= parent.ssj_0:\n self.y = parent.y\n self.x = parent.x\nif charge_power >= parent.ssj_1:\n powerup_effect.x = parent.x\n powerup_effect.y = parent.y\nif charge_power >= parent.ssj_2:\n self.y = parent.y + 22\nif charge_power >= parent.ssj_3:\n powerup_effect.x = parent.x + 40 * parent.facing\n powerup_effect.y = parent.y + 4\nif charge_power >= parent.ssj_4:\n powerup_effect.x = parent.x + 50 * parent.facing\n powerup_effect.y = parent.y + 5\nif charge_power >= parent.ssj_5:\n powerup_effect.x = parent.x + 80 * parent.facing\n powerup_effect.y = parent.y + 10\nif charge_power >= parent.ssj_6:\n powerup_effect.x = parent.x + 100 * parent.facing\n powerup_effect.y = parent.y + 15\n\nif charge_power < 500:\n charge_power +=0.125\n\n#sprite_height = 1+ charge_power \/ 500\n#sprite_width = 1+ charge_power \/ 500\n\n\n "},"spr_mmx_ssj_2":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mmx_ssj_2.png"},"obj_special_effect":{"type":"object script","start":"# Enter the start code for obj_special_effect here.\n\ntimer = 24\n","loop":"# Enter the loop code for obj_special_effect here.\n\ntimer -=1\nx = parent.x\ny = parent.y\nif timer < 0:\n object_destroy(self)"},"obj_charging_2":{"type":"object script","start":"# Enter the start code for obj_charging_2 here.\n\ny = 100000","loop":"# Enter the loop code for obj_charging_2 here."},"spr_mmx_ssj_flash":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mmx_ssj_flash.png"},"spr_mmx_ssj_aura_blue":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mmx_ssj_aura_blue.png"},"spr_mmx_ssj_aura_red":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mmx_ssj_aura_red.png"},"spr_mmx_ssj_aura_yellow":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mmx_ssj_aura_yellow.png"},"spr_mmx_ssj_aura_black":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mmx_ssj_aura_black.png"},"spr_mmx_ssj_flash2":{"type":"image","uri":"https:\/\/pixelpad.io\/wp-content\/uploads\/project_assets\/2533\/72617\/spr_mmx_ssj_flash2.png"},"rm_level_02":{"type":"room script","start":"# Enter the start code for rm_level_02 here.\n\n# Mapping Primitives\n\nBLOCK_SIZE = 32\n\nspawn_x = 0\nspawn_y = 0\n\ndef move_horz(dx):\n spawn_x += dx * BLOCK_SIZE\n\ndef move_vert(dy):\n spawn_y += dy * BLOCK_SIZE\n\ndef blocks_horz(count):\n result = []\n dir = game.sign(count)\n \n for i in range(abs(count)):\n b = object_new(‘obj_nrm_block’)\n result.append(b)\n \n b.x = spawn_x + i * BLOCK_SIZE * dir\n b.y = spawn_y\n \n move_horz(count)\n return result\n \ndef blocks_vert(count):\n result = []\n dir = game.sign(count)\n \n for i in range(abs(count)):\n b = object_new(‘obj_nrm_block’)\n result.append(b)\n \n b.x = spawn_x\n b.y = spawn_y + i * BLOCK_SIZE * dir\n \n move_vert(count)\n return result\n \ndef enemy_gnd(rel_x, rel_y, patrol_L, patrol_R):\n e = object_new(‘obj_gnd_enemy’)\n e.x = spawn_x + rel_x * BLOCK_SIZE\n e.y = spawn_y + rel_y * BLOCK_SIZE\n e.patrol_L = spawn_x + (rel_x + patrol_L) * BLOCK_SIZE\n e.patrol_R = spawn_x + (rel_x + patrol_R) * BLOCK_SIZE\n return e\n \ndef win_zone(rel_x, rel_y):\n z = object_new(‘obj_win_zone’)\n z.x = spawn_x + rel_x * BLOCK_SIZE\n z.y = spawn_y + rel_y * BLOCK_SIZE\n return z\n \n# Major Sections\n \ndef section_01():\n blocks_horz(15)\n blocks_horz(20)\n enemy_gnd(-3, 1, -2, 2)\n blocks_horz(10)\n move_horz(3)\n blocks_vert(-2)\n blocks_horz(10)\n \ndef section_02():\n blocks_horz(1)\n blocks_vert(1)\n blocks_horz(1)\n blocks_vert(1)\n blocks_horz(2)\n enemy_gnd(-2, 1, 0, 1)\n blocks_vert(2)\n blocks_horz(5)\n \ndef section_03():\n blocks_vert(-10)\n blocks_horz(5)\n move_vert(4)\n blocks_horz(10)\n move_horz(-10)\n move_vert(-4)\n move_horz(2)\n blocks_horz(3)\n move_horz(2)\n blocks_horz(3)\n move_horz(2)\n blocks_horz(2)\n enemy_gnd(-1, 1, 0, 0)\n blocks_vert(2)\n blocks_horz(2)\n blocks_vert(2)\n\ndef section_long_jump():\n blocks_horz(10)\n move_horz(6)\n blocks_horz(5)\n\ndef section_04():\n move_horz(2)\n blocks_horz(1)\n move_horz(2)\n blocks_vert(3)\n enemy_gnd(0, 0, 0, 0)\n move_horz(3)\n move_vert(-2)\n blocks_horz(1)\n move_horz(2)\n blocks_vert(3)\n enemy_gnd(0, 0, 0, 0)\n move_horz(3)\n move_vert(-2)\n blocks_horz(1)\n move_horz(2)\n blocks_vert(2)\n enemy_gnd(0, 0, 0, 0)\n move_horz(2)\n blocks_vert(1)\n move_horz(2)\n blocks_vert(1)\n move_horz(3)\n blocks_vert(2)\n move_horz(2)\n move_vert(1)\n blocks_horz(20)\n \ndef section_05():\n move_horz(2)\n blocks_horz(1)\n move_horz(2)\n blocks_vert(2)\n enemy_gnd(0, 0, 0, 0)\n move_horz(3)\n move_vert(-2)\n blocks_horz(1)\n move_horz(2)\n blocks_vert(2)\n enemy_gnd(0, 0, 0, 0)\n move_horz(3)\n move_vert(-2)\n blocks_horz(1)\n move_horz(2)\n blocks_vert(2)\n enemy_gnd(0, 0, 0, 0)\n move_horz(2)\n blocks_vert(1)\n move_horz(2)\n blocks_vert(1)\n move_horz(3)\n blocks_vert(2)\n move_horz(2)\n move_vert(1)\n blocks_horz(20)\n \n win_zone(-1, 1)\n\npc = object_new(‘obj_pc’)\nbg = game.make_background([‘spr_bg_city’])\n\ngame.pc = pc\n\nmove_vert(-4)\nmove_horz(-4)\nblocks_vert(20)\nmove_vert(-20)\n\nsection_01()\nsection_02()\nsection_03()\nsection_long_jump()\nsection_long_jump()\nsection_long_jump()\nsection_04()\nsection_01()\nsection_02()\nsection_long_jump()\nsection_02()\nsection_long_jump()\nsection_03()\nsection_long_jump()\nsection_05()\n\n#bgm = sound_new(‘snd_bgm’)\n#sound_volume(10)\n#sound_loop(bgm)","loop":"# Enter the loop code for rm_level_02 here.\n\ngame.tick_background(bg)\n\nif game.pc.y <= -400:\n game.die(game.pc)"},"obj_pc_afterimage":{"type":"object script","start":"# Enter the start code for obj_pc_afterimage here.\n\ntimer = 10\nz = -1","loop":"# Enter the loop code for obj_pc_afterimage here.\n\ntimer -=1\n\nif timer < 0:\n object_destroy(self)"},"obj_dst_block":{"type":"object script","start":"# Enter the start code for obj_dst_block here.\n\n\nsprite = sprite_new(\"spr_tiles\", 2,2)\nsprite.cell = 2\n\nxspeed = 0\nyspeed = 0\n\nfall = False","loop":"# Enter the loop code for obj_dst_block here.\n\nself.x += xspeed\nself.y += yspeed\n\nif fall:\n yspeed -= 2\n \nif y < -1000:\n object_destroy(self)"}}

0
72617