Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Information about object: obj_sawling
- Sprite: spr_sawling_idle
- Solid: false
- Visible: true
- Depth: 0
- Persistent: false
- Parent: ParEnemy
- Children:
- Mask:
- No Physics Object
- Create Event:
- execute code:
- image_speed = 0;
- alarm[0] = 120;
- //orbit_angle = 180;
- //orbit_radius = 80;
- //orbit_speed = 3;
- //inst_amount = 1;
- is_moving = false;
- my_parent = 0;
- orbit_angle = 0;
- orbit_speed = 18;
- inst_amount = 3; //CAN CHANGE
- angle_offset = 0; //WOULD NOT CHANGE
- i = 0
- new_offset = 720/inst_amount
- while x < 128 || x > room_width-128
- || x < obj_ball.x+120 || y < 128 || y > room_height-128 {
- x = irandom_range(0,room_width);
- y = irandom_range(0,room_height);
- }
- Alarm Event for alarm 0:
- execute code:
- alarm[0] = 210;
- if is_moving = false {
- is_moving = true;
- } else {
- is_moving = false;
- speed = 0;
- }
- Step Event:
- execute code:
- movespeed = 1.04+(0.05*Events.level);
- if instance_exists(obj_ball) && is_moving = true && Events.faint = false {
- if obj_ball.x <= x {
- image_index = 2;
- }
- if obj_ball.x > x {
- image_index = 1;
- }
- if instance_exists(obj_ball) {
- saw_direction = move_towards_point(obj_ball.x,obj_ball.y,movespeed);
- }
- if place_meeting(x,y,ParEnemy) {
- with instance_place(x,y,obj_sawling) {
- move_towards_point(other.x,other.y,-movespeed); //-towards = away
- }
- }
- }
- if is_moving = false {
- image_index = 0;
- speed = 0;
- }
- if i < inst_amount
- {
- for(i=0; i < inst_amount; i+=1)
- {
- with(instance_create(x,y,obj_sawling_blade))
- {
- orbit_parent = other.my_parent
- orbit_angle = other.orbit_angle+other.angle_offset
- orbit_speed = other.orbit_speed
- image_angle = orbit_angle
- image_xscale = other.image_xscale
- image_yscale = other.image_yscale
- }
- angle_offset += new_offset
- }
- }
- Information about object: obj_sawling_blade
- Sprite: spr_sawling_blade
- Solid: false
- Visible: true
- Depth: 1999
- Persistent: false
- Parent: ParEnemy
- Children:
- Mask:
- No Physics Object
- Create Event:
- execute code:
- orbit_angle = 0;
- orbit_radius = 0;
- orbit_speed = 4;
- orbit_parent = instance_nearest(x,y,obj_sawling);
- Step Event:
- execute code:
- image_angle = orbit_angle;
- if instance_nearest(x,y,obj_sawling).is_moving = true {
- //orbit_angle += orbit_speed;
- }
- if instance_exists(instance_nearest(x,y,obj_sawling)) && instance_nearest(x,y,obj_sawling).is_moving = true
- {
- orbit_angle += orbit_speed;
- x = instance_nearest(x,y,obj_sawling).x + orbit_radius * cos(orbit_angle * pi / 360);
- y = instance_nearest(x,y,obj_sawling).y - orbit_radius * sin(orbit_angle * pi / 360);
- }
- Draw Event:
- execute code:
- draw_self()
- Information about object: Events
- Sprite:
- Solid: false
- Visible: true
- Depth: -100
- Persistent: true
- Parent:
- Children:
- Mask:
- No Physics Object
- Create Event:
- execute code:
- game_over = false;
- faint = false;
- set_alarm = false;
- level_won = false;
- level = 1;
- lifes = 3;
- Alarm Event for alarm 0:
- execute code:
- ///reset after faint
- if lifes = 1 && faint = true {
- audio_play_sound(snd_game_stop,1,false);
- game_over = true;
- }
- if lifes >= 1 && set_alarm = true {
- room_restart();
- alarm[0] = -1
- if level_won = true {
- level += 1;
- }
- set_alarm = false;
- level_won = false;
- }
- if faint = true {
- lifes -= 1;
- faint = false;
- }
- Step Event:
- execute code:
- if keyboard_check(vk_shift) {
- game_restart();
- }
- if room = intro_screen && keyboard_check(vk_space) {
- room_goto(ball_room);
- }
- if faint = true || level_won = true
- if set_alarm = false {
- alarm[0] = 180;
- set_alarm = true;
- }
- if instance_exists(obj_medal)
- if instance_nearest(x,y,obj_medal).is_collected = true {
- level_won = true;
- }
- if keyboard_check(vk_shift) && game_over = true {
- game_restart();
- }
- //window_set_size(800,600);
- Draw Event:
- execute code:
- title = "RolloMania";
- titledesc = "Press Space to Start!";
- version = "Version 0.13";
- draw_set_font(font_title);
- if room = intro_screen {
- text_draw(view_xview+view_wview/2-string_width(title)/2,view_yview+64,title,c_white);
- draw_set_font(font_main);
- text_draw(view_xview+view_wview/2-string_width(titledesc)/2,view_yview+200,titledesc,c_white);
- text_draw(view_xview+8,view_yview+view_hview-16,version,c_yellow);
- }
- draw_set_font(font_main);
- if Events.faint = true {
- draw_set_color(c_black);
- draw_set_alpha(0.8);
- draw_rectangle(view_xview,view_yview,view_xview+view_wview,view_yview+view_hview,false);
- }
- if Events.game_over = true {
- draw_set_color(c_black);
- draw_set_alpha(0.9);
- draw_rectangle(view_xview,view_yview,view_xview+view_wview,view_yview+view_hview,false);
- draw_set_alpha(1);
- }
- if Events.level_won = true {
- draw_set_color(c_yellow);
- draw_set_alpha(0.2);
- draw_rectangle(view_xview,view_yview,view_xview+view_wview,view_yview+view_hview,false);
- draw_set_alpha(1);
- }
- level_text = "Level "+string(level);
- if room = ball_room {
- if Events.faint = false || Events.level_won = false {
- text_draw(view_xview+view_wview/2-string_width(level_text)/2,view_yview+16,level_text,c_yellow);
- text_draw(view_xview+16,view_yview+16,"Lives: "+string(lifes),c_white);
- }
- if Events.game_over = true {
- text_draw(view_xview+view_wview/2-(string_width("Game Stop")/2),view_yview+view_hview/2,"Game Stop",c_orange);
- text_draw(view_xview+view_wview/2-string_width("(Press Shift to Restart)")/2,view_yview+view_hview/2+32,"(Press Shift to Restart)",c_orange);
- }
- }
- Information about object: obj_ball_faint
- Sprite: spr_ball_faint
- Solid: false
- Visible: true
- Depth: -10000
- Persistent: false
- Parent:
- Children:
- Mask:
- No Physics Object
- Create Event:
- execute code:
- vspeed = 0;
- Events.faint = true;
- Step Event:
- execute code:
- vspeed -= 0.02;
- Information about object: obj_medal
- Sprite: spr_victory_medal
- Solid: false
- Visible: true
- Depth: 0
- Persistent: false
- Parent:
- Children:
- Mask:
- No Physics Object
- Create Event:
- execute code:
- image_speed = 0.3;
- is_collected = false;
- is_moving = false;
- while x < 128 || x > room_width-128
- || x < obj_ball.x+120 || y < 128 || y > room_height-128 {
- x = irandom_range(0,room_width);
- y = irandom_range(0,room_height);
- }
- Step Event:
- execute code:
- if place_meeting(x,y,obj_ball) && distance_to_object(instance_nearest(x,y,obj_ball)) < 20 {
- is_collected = true;
- image_speed = 0.4;
- }
- if is_collected = true && is_moving = false {
- vspeed = 4;
- audio_play_sound(snd_medal,1,false);
- is_moving = true;
- }
- if is_moving = true {
- hspeed = 0;
- vspeed -= 0.25;
- }
- Information about object: obj_ball
- Sprite: spr_ball_vmove
- Solid: false
- Visible: true
- Depth: 0
- Persistent: false
- Parent:
- Children:
- Mask:
- No Physics Object
- Create Event:
- execute code:
- image_speed = 0;
- move_speed = 0;
- if !instance_exists(Events) {
- instance_create(0,0,Events);
- }
- Step Event:
- execute code:
- left = keyboard_check(vk_left);
- right = keyboard_check(vk_right);
- up = keyboard_check(vk_up);
- down = keyboard_check(vk_down);
- if !up && !down && !right && !left {
- move_speed = 0;
- hspeed = 0;
- vspeed = 0;
- sprite_index = spr_ball_vmove;
- image_index = 0;
- image_speed = 0;
- image_xscale = 1;
- image_yscale = 1;
- } else {
- move_speed = 3;
- }
- if instance_exists(Events) && Events.faint = false && Events.level_won = false {
- if place_meeting(x,y,ParEnemy) && Events.level_won = false {
- instance_create(x,y,obj_ball_faint);
- instance_destroy();
- audio_play_sound(snd_ball_faint,1,false);
- }
- if left || right || up || down
- if !audio_is_playing(snd_ball_move) && Events.level_won = false {
- audio_play_sound(snd_ball_move,1,false);
- }
- if x <= 32 {
- hspeed = 0;
- x+=1;
- }
- if x >= room_width-32 {
- hspeed = 0;
- x-=1;
- }
- if y <= 32 {
- vspeed = 0;
- y+=1;
- }
- if y >= room_height-32 {
- vspeed = 0;
- y-=1;
- }
- if left && Events.level_won = false && x > 32 {
- sprite_index = spr_ball_hmove;
- image_speed = 0.2;
- image_xscale = -1;
- image_yscale = 1;
- hspeed = -move_speed;
- vspeed = 0;
- }
- if right && Events.level_won = false && x < room_width-32 {
- sprite_index = spr_ball_hmove;
- image_speed = 0.2;
- image_xscale = 1;
- image_yscale = 1;
- hspeed = move_speed;
- vspeed = 0;
- }
- if up && Events.level_won = false && y > 32 {
- sprite_index = spr_ball_vmove;
- image_speed = 0.2;
- image_xscale = 1;
- image_yscale = 1;
- hspeed = 0;
- vspeed = -move_speed;
- }
- if down && Events.level_won = false && y < room_height-32 {
- sprite_index = spr_ball_vmove;
- image_speed = 0.2;
- image_xscale = 1;
- image_yscale = -1;
- hspeed = 0;
- vspeed = move_speed;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement