Did some minor tweaks for better gameplay
This commit is contained in:
parent
cfa3a60528
commit
3284c129fb
|
@ -6,7 +6,7 @@
|
|||
|
||||
<window fps="60" background="0x000000" />
|
||||
<window width="360" height="640" resizable="false" unless="mobile" />
|
||||
<window orientation="portrait" height="1280" width="720" fullscreen="true" if="mobile" />
|
||||
<window orientation="portrait" fullscreen="true" if="mobile" />
|
||||
<window orientation="portrait" vsync="true" antialiasing="8" if="cpp" />
|
||||
|
||||
<source path="src" />
|
||||
|
|
17
src/Boss.hx
17
src/Boss.hx
|
@ -90,25 +90,30 @@ class Boss extends Entity {
|
|||
|
||||
var bullet:Entity = this.collide("bullet", this.x, this.y);
|
||||
var heavybullet:Entity = this.collide("heavybullet", this.x, this.y);
|
||||
var score:Array<Score> = [];
|
||||
this.scene.getClass(Score, score);
|
||||
|
||||
if (bullet != null || heavybullet != null) {
|
||||
var score:Array<Score> = [];
|
||||
this.scene.getClass(Score, score);
|
||||
if (bullet != null) {
|
||||
score[0].add(1500);
|
||||
}
|
||||
|
||||
if (heavybullet != null) {
|
||||
score[0].add(10);
|
||||
}
|
||||
|
||||
if (bullet != null) {
|
||||
if (Save.load().laser == 0)
|
||||
damage = 1;
|
||||
else if (Save.load().laser == 1)
|
||||
damage = 1.25;
|
||||
else if (Save.load().laser == 2)
|
||||
damage = 1.5;
|
||||
this.health -= damage;
|
||||
this.scene.remove(bullet);
|
||||
}
|
||||
else if (heavybullet != null) {
|
||||
this.health -= 2;
|
||||
if (Save.load().heavy_laser == 0)
|
||||
this.health -= .5;
|
||||
else
|
||||
this.health -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,14 +8,18 @@ class Bullet extends Entity {
|
|||
super(x, y);
|
||||
isHeavyLaser = heavylaser;
|
||||
|
||||
which = Save.load().laser;
|
||||
if (!isHeavyLaser)
|
||||
which = Save.load().laser;
|
||||
else
|
||||
which = Save.load().heavy_laser;
|
||||
|
||||
if (!isHeavyLaser) {
|
||||
laser1 = new Image(laser[which][0]);
|
||||
laser2 = new Image(laser[which][1]);
|
||||
}
|
||||
else {
|
||||
laser1 = new Image("graphics/laserBlue15.png");
|
||||
laser2 = new Image("graphics/laserBlue16.png");
|
||||
laser1 = new Image(heavy_laser[which][0]);
|
||||
laser2 = new Image(heavy_laser[which][1]);
|
||||
}
|
||||
|
||||
graphic = laser1;
|
||||
|
@ -65,16 +69,23 @@ class Bullet extends Entity {
|
|||
"graphics/laserGreen04.png",
|
||||
"graphics/laserGreen12.png"
|
||||
],
|
||||
[
|
||||
"graphics/laserGreen10.png",
|
||||
"graphics/laserGreen06.png"
|
||||
],
|
||||
[
|
||||
"graphics/laserBlue02.png",
|
||||
"graphics/laserBlue06.png"
|
||||
]
|
||||
];
|
||||
|
||||
private var heavy_laser:Array<Array<String>> = [
|
||||
[
|
||||
"graphics/laserGreen06.png",
|
||||
"graphics/laserGreen10.png"
|
||||
],
|
||||
[
|
||||
"graphics/laserBlue15.png",
|
||||
"graphics/laserBlue16.png"
|
||||
]
|
||||
];
|
||||
|
||||
private var laser1:Image;
|
||||
private var laser2:Image;
|
||||
private var isHeavyLaser:Bool = false;
|
||||
|
|
|
@ -144,8 +144,6 @@ class Enemy extends Entity {
|
|||
if (Save.load().laser == 0)
|
||||
damage = 1;
|
||||
else if (Save.load().laser == 1)
|
||||
damage = 1.25;
|
||||
else if (Save.load().laser == 2)
|
||||
damage = 1.5;
|
||||
health -= damage;
|
||||
var score:Array<Score> = [];
|
||||
|
@ -156,7 +154,10 @@ class Enemy extends Entity {
|
|||
this.scene.remove(bullet);
|
||||
}
|
||||
else if (heavybullet != null) {
|
||||
this.health -= 2;
|
||||
if (Save.load().heavy_laser == 0)
|
||||
this.health -= .5;
|
||||
else
|
||||
this.health -= 1;
|
||||
}
|
||||
|
||||
if (health <= 0) {
|
||||
|
|
|
@ -13,6 +13,8 @@ class Main extends Engine
|
|||
#if !android
|
||||
HXP.screen.scale = .5;
|
||||
HXP.resize(360, 640);
|
||||
#else
|
||||
HXP.resize(720, 1280);
|
||||
#end
|
||||
|
||||
HXP.scene = new MenuScene();
|
||||
|
|
|
@ -96,7 +96,7 @@ class Player extends Entity {
|
|||
}
|
||||
|
||||
if (Input.released("shoot")) {
|
||||
if (holdShoot > .5 && Save.load().has_heavy_laser) {
|
||||
if (holdShoot > .5) {
|
||||
heavyShoot();
|
||||
holdShoot = 0;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ class Save extends Entity {
|
|||
"ship_type" : Data.readInt("ship_type", 3),
|
||||
"ship_color" : Data.readInt("ship_color", 1),
|
||||
"laser" : Data.readInt("laser", 0),
|
||||
"has_heavy_laser" : Data.readBool("heavy_laser", false),
|
||||
"heavy_laser" : Data.readInt("heavy_laser", 0),
|
||||
"money" : Data.readInt("money", 1000),
|
||||
"overlay" : Data.readBool("overlay", true)
|
||||
};
|
||||
|
@ -33,7 +33,7 @@ class Save extends Entity {
|
|||
Data.write("ship_type", 3);
|
||||
Data.write("ship_color", 1);
|
||||
Data.write("laser", "laserGreen04.png");
|
||||
Data.write("heavy_laser", false);
|
||||
Data.write("heavy_laser", 0);
|
||||
Data.write("money", 1000);
|
||||
Data.write("overlay", true);
|
||||
|
||||
|
|
|
@ -44,8 +44,7 @@ class StoreItem extends Entity {
|
|||
sprites[i].centerOrigin();
|
||||
}
|
||||
|
||||
if (type != 4) currentSprite = 1;
|
||||
else currentSprite = 0;
|
||||
currentSprite = 1;
|
||||
|
||||
this.addGraphic(sprites[currentSprite]);
|
||||
|
||||
|
@ -90,7 +89,7 @@ class StoreItem extends Entity {
|
|||
}
|
||||
else {
|
||||
if (which == 4)
|
||||
Save.save("heavy_laser", true);
|
||||
Save.save("heavy_laser", currentSprite);
|
||||
else
|
||||
Save.save("laser", currentSprite);
|
||||
}
|
||||
|
@ -145,10 +144,10 @@ class StoreItem extends Entity {
|
|||
],
|
||||
[
|
||||
"laserGreen04.png",
|
||||
"laserGreen06.png",
|
||||
"laserBlue06.png"
|
||||
],
|
||||
[
|
||||
"laserGreen06.png",
|
||||
"laserBlue16.png"
|
||||
]
|
||||
];
|
||||
|
@ -171,10 +170,10 @@ class StoreItem extends Entity {
|
|||
],
|
||||
[
|
||||
"This is the laser you start with, it's decent & does 1 damage.",
|
||||
"This laser is slightly better than the one you start with, it does 1.5 damage.",
|
||||
"This laser does the same amount of damage as you're first, but moves slighly faster."
|
||||
],
|
||||
[
|
||||
"This heavy laser is the strongest laser, it serves as a secondary. To use, hold the shoot button for a few seconds & then release.",
|
||||
"This heavy laser is the strongest laser, it serves as a secondary. To use, hold the shoot button for a few seconds & then release."
|
||||
]
|
||||
];
|
||||
|
@ -196,11 +195,11 @@ class StoreItem extends Entity {
|
|||
500000
|
||||
],
|
||||
[
|
||||
50000,
|
||||
100000,
|
||||
150000
|
||||
],
|
||||
[
|
||||
100000,
|
||||
200000
|
||||
]
|
||||
|
||||
|
|
Reference in a new issue