Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (collision_point(x,y,obj_planet,1,1)) { speed = -1; if(playerShield > 0) { playerShield -= 300; } else { playerLife -= 300; } }
- if (collision_point(x,y,obj_planet2,1,1)) { speed = -1; }
- if (collision_point(x,y,obj_planet3,1,1)) { speed = -1; if(playerShield > 0) { playerShield -= 300; } else { playerLife -= 300; } }
- if (collision_point(x,y,obj_Enemy_Robot1,1,1)) { speed = -1; }
- if (collision_point(x,y,obj_sun1,1,1)) { speed = -1; }
- if (collision_point(x,y,obj_JugsShip,1,1)) { speed = -1; }
- // CHEATING ZE !
- if keyboard_check_pressed(vk_f2) { shieldRegenRate = 20; powerRegenRate = 20; playerMPower = 65000; playerMShield = 65000; playerMLife = 65000; playerLife = playerMLife; }
- if keyboard_check_pressed(vk_f3) { missileAmmo += 500; nanobots += 500; shieldbattery += 500; }
- if keyboard_check_pressed(vk_numpad9) { playerCredit += 50000; }
- if keyboard_check_pressed(vk_numpad7) {
- missx = 0;
- //sound_play(se_missile);
- while (missx < 36) {
- cheatshot = instance_create(x+15*cos(missdir),y+15*sin(missdir),obj_missile);
- cheatshot.speed = 0.1;
- cheatshot.direction = missdir;
- cheatshot.image_angle = direction-90;
- missdir += 360/36;
- missx += 1;
- }
- }
- // Rotation and movement and controlls
- if keyboard_check(vk_up) { if ( speed < 3) { speed += 0.5 } }
- if keyboard_check(vk_down) {
- if ( isWarp == true) { speed = 3; isWarp = false; }
- if ( speed > -3 ) { speed -= 0.5 }
- }
- if keyboard_check(vk_left) { direction+=3; }
- if keyboard_check(vk_right) { direction-=3; }
- image_angle = direction-90;
- // Player Experience and Leveling
- if playerXP >= playerNXP {
- playerXP -=playerNXP;
- playerLevel +=1;
- playerNXP *=2;
- playerLife *=1.5;
- playerMLife *=1.5;
- playerShield *=1.2;
- playerMShield *=1.2;
- }
- // tractor beam code
- if (keyboard_check_pressed(vk_numpad1)) {
- if(isTractor == false) {
- if (playerPower >= 10) {
- sound_play(se_Tractorbeam2);
- isTractor = true;
- playerPower -= 10;
- }
- }
- else { isTractor = false; } // nu kun je hem ook uitzetten!
- }
- // warp mode
- if (keyboard_check_pressed(vk_numpad4)) {
- if (disWarp == false) {
- if (isWarp == false) {
- if (playerPower >= 100) {
- isWarp = true;
- speed = 15;
- playerPower -= 100;
- }
- }
- }
- }
- // 3 statements voor warp checking. 1) indien warp -> drain power. 2) indien warp + power op -> warp uit 3) indien warp + speed <3 -> warp uit
- if (isWarp == true) { playerPower -= warpDrain; }
- if (isWarp == true && playerPower <= 0 ) { isWarp = false; speed = 3; }
- if (isWarp == true && speed <= 3) { isWarp = false; }
- // only count when isTractor is true
- if (isTractor == true) {
- //countTractor += 1; // count
- //if(countTractor = 240) { isTractor = false; countTractor = 0; } // tractor is activated for this many frames
- }
- // dit block mag enkel worden uitgevoerd indien warp mode inactief is!
- if (isWarp == false) {
- // Main Laser fire code
- if (keyboard_check(vk_space) && countlaser == -1) {
- countlaser = 0;
- }
- if (keyboard_check(vk_space)) {
- if (countlaser == 0) {
- if(playerPower > laserPowerDrain) {
- shotlaser = instance_create(playership.x,playership.y,pewshot);
- shotlaser.speed = 20;
- shotlaser.direction = playership.direction;
- shotlaser.image_angle = playership.direction+90;
- sound_play(se_pew);
- playerPower -= laserPowerDrain;
- }
- }
- if (countlaser >= 0) { countlaser += 1; }
- if (countlaser >= laserRefireRate) { countlaser = -1; }
- }
- // Fire Missiles
- if (keyboard_check(vk_shift) && countmissile == -1) {
- countmissile = 0;
- }
- if (keyboard_check(vk_shift)) {
- if (countmissile == 0 ) {
- if (missileAmmo > 0) {
- shot = instance_create(x,y,obj_missile);
- shot.speed = 0.1;
- shot.direction = direction;
- shot.image_angle = direction-90;
- sound_play(se_missile);
- missileAmmo -= 1;
- }
- }
- if (countmissile >= 0) { countmissile += 1; }
- if (countmissile >= missileRefireRate) { countmissile = -1; }
- }
- }
- // player life correctie
- {
- if (playerLife < 0) { playerLife = 0; } // voorkomen dat stuff fout gaat
- }
- // power regen code
- {
- if (playerPower < playerMPower) { playerPower += powerRegenRate; } // regen rate
- if (playerPower > playerMPower) { playerPower = playerMPower; } // voorkomen dat stuff fout gaat
- if (playerPower < 0) { playerPower = 0; } // voorkomen dat stuff fout gaat
- }
- // shield regen code
- {
- if (playerShield < playerMShield) { playerShield += shieldRegenRate; } // regen rate
- if (playerShield > playerMShield) { playerShield = playerMShield; } // voorkomen dat stuff fout gaat
- //if (playerShield < 0) { playerShield = 0; } // voorkomen dat stuff fout gaat
- }
- //Sound when object is passed at high velocity
- if distance_to_object(obj_Asteroid2_1) <=10 and speed >= 10 {
- sound_play(se_Zoof);
- }
- if distance_to_object(obj_Asteroid2_2) <=10 and speed >= 10 {
- sound_play(se_Zoof);
- }
- if distance_to_object(obj_Asteroid2_3) <=10 and speed >= 10 {
- sound_play(se_Zoof);
- }
- if distance_to_object(obj_Enemy_Robot1) <=10 and speed >= 10 {
- sound_play(se_Zoof);
- }
- if distance_to_object(obj_EnemyRaider1) <=10 and speed >= 10 {
- sound_play(se_Zoof);
- }
- if distance_to_object(obj_EnemyRaider2) <=10 and speed >= 10 {
- sound_play(se_Zoof);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement