Added new graphics and added a StoreScene.hx
BIN
assets/graphics/laserBlue01.png
Normal file
After Width: | Height: | Size: 744 B |
BIN
assets/graphics/laserBlue02.png
Normal file
After Width: | Height: | Size: 318 B |
BIN
assets/graphics/laserBlue03.png
Normal file
After Width: | Height: | Size: 274 B |
BIN
assets/graphics/laserBlue04.png
Normal file
After Width: | Height: | Size: 322 B |
BIN
assets/graphics/laserBlue05.png
Normal file
After Width: | Height: | Size: 276 B |
BIN
assets/graphics/laserBlue06.png
Normal file
After Width: | Height: | Size: 691 B |
BIN
assets/graphics/laserBlue07.png
Normal file
After Width: | Height: | Size: 617 B |
BIN
assets/graphics/laserBlue08.png
Normal file
After Width: | Height: | Size: 882 B |
BIN
assets/graphics/laserBlue09.png
Normal file
After Width: | Height: | Size: 754 B |
BIN
assets/graphics/laserBlue10.png
Normal file
After Width: | Height: | Size: 771 B |
BIN
assets/graphics/laserBlue11.png
Normal file
After Width: | Height: | Size: 719 B |
BIN
assets/graphics/laserBlue12.png
Normal file
After Width: | Height: | Size: 321 B |
BIN
assets/graphics/laserBlue13.png
Normal file
After Width: | Height: | Size: 281 B |
BIN
assets/graphics/laserBlue14.png
Normal file
After Width: | Height: | Size: 332 B |
BIN
assets/graphics/laserBlue15.png
Normal file
After Width: | Height: | Size: 282 B |
BIN
assets/graphics/laserBlue16.png
Normal file
After Width: | Height: | Size: 802 B |
BIN
assets/graphics/playerShip1_blue.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
assets/graphics/playerShip1_orange.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
assets/graphics/playerShip1_red.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
assets/graphics/playerShip2_blue.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
assets/graphics/playerShip2_green.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
assets/graphics/playerShip2_orange.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
assets/graphics/playerShip2_red.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
assets/graphics/playerShip3_blue.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/graphics/playerShip3_green.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/graphics/playerShip3_orange.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
assets/graphics/playerShip3_red.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
|
@ -7,12 +7,12 @@ class Bullet extends Entity {
|
||||||
public function new(x:Float, y:Float) {
|
public function new(x:Float, y:Float) {
|
||||||
super(x, y);
|
super(x, y);
|
||||||
|
|
||||||
laser1 = new Image("graphics/laserGreen09.png");
|
laser1 = new Image("graphics/laserGreen04.png");
|
||||||
laser2 = new Image("graphics/laserGreen13.png");
|
laser2 = new Image("graphics/laserGreen12.png");
|
||||||
|
|
||||||
graphic = laser1;
|
graphic = laser1;
|
||||||
|
|
||||||
setHitbox(9, 37);
|
setHitboxTo(laser1);
|
||||||
|
|
||||||
type = "bullet";
|
type = "bullet";
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,7 @@ class Main extends Engine
|
||||||
HXP.resize(360, 640);
|
HXP.resize(360, 640);
|
||||||
#end
|
#end
|
||||||
|
|
||||||
// HXP.scene = new MainScene();
|
HXP.scene = new StoreScene();
|
||||||
HXP.scene = new MenuScene();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function main() { new Main(); }
|
public static function main() { new Main(); }
|
||||||
|
|
124
src/StoreItem.hx
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
import com.haxepunk.Entity;
|
||||||
|
import com.haxepunk.graphics.Image;
|
||||||
|
import com.haxepunk.graphics.Text;
|
||||||
|
import openfl.Assets;
|
||||||
|
|
||||||
|
class StoreItem extends Entity {
|
||||||
|
|
||||||
|
public function new(x:Float, y:Float, type:Int) {
|
||||||
|
super(x, y);
|
||||||
|
|
||||||
|
button = new Image("graphics/buttonGreen.png");
|
||||||
|
button.scale = 2;
|
||||||
|
|
||||||
|
|
||||||
|
text = new Text(itemnames[type]);
|
||||||
|
text.color = 0x000000;
|
||||||
|
text.size = 40;
|
||||||
|
text.font = Assets.getFont("font/kenpixel_mini_square.ttf").fontName;
|
||||||
|
|
||||||
|
this.x += 120;
|
||||||
|
|
||||||
|
setHitbox(button.width * 2, button.height * 2);
|
||||||
|
|
||||||
|
text.centerOrigin();
|
||||||
|
button.centerOrigin();
|
||||||
|
this.centerOrigin();
|
||||||
|
|
||||||
|
for (i in 0...items[type].length) {
|
||||||
|
sprites[i] = new Image("graphics/" + items[type][i]);
|
||||||
|
sprites[i].x = -350;
|
||||||
|
sprites[i].centerOrigin();
|
||||||
|
}
|
||||||
|
|
||||||
|
arrowLeft = new Image("graphics/fire05.png");
|
||||||
|
arrowLeft.angle = 90;
|
||||||
|
arrowLeft.x = -440;
|
||||||
|
arrowLeft.centerOrigin();
|
||||||
|
|
||||||
|
arrowRight = new Image("graphics/fire05.png");
|
||||||
|
arrowRight.angle = -90;
|
||||||
|
arrowRight.x = -260;
|
||||||
|
arrowRight.centerOrigin();
|
||||||
|
|
||||||
|
|
||||||
|
this.addGraphic(sprites[0]);
|
||||||
|
|
||||||
|
this.addGraphic(arrowLeft);
|
||||||
|
this.addGraphic(arrowRight);
|
||||||
|
|
||||||
|
this.addGraphic(button);
|
||||||
|
this.addGraphic(text);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private var button:Image;
|
||||||
|
|
||||||
|
private var sprites:Array<Image> = [];
|
||||||
|
private var arrowLeft:Image;
|
||||||
|
private var arrowRight:Image;
|
||||||
|
|
||||||
|
private var text:Text;
|
||||||
|
|
||||||
|
public static var itemnames:Array<String> = [
|
||||||
|
"Fat Jumper",
|
||||||
|
"Speeder Jumper",
|
||||||
|
"X3 Jumper",
|
||||||
|
"V2 Laser",
|
||||||
|
"Heavy Laser"
|
||||||
|
];
|
||||||
|
|
||||||
|
private var items:Array<Array<String>> = [
|
||||||
|
[
|
||||||
|
"playerShip3_green.png",
|
||||||
|
"playerShip3_blue.png",
|
||||||
|
"playerShip3_orange.png"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"playerShip1_green.png",
|
||||||
|
"playerShip1_blue.png",
|
||||||
|
"playerShip1_orange.png"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"playerShip2_green.png",
|
||||||
|
"playerShip2_blue.png",
|
||||||
|
"playerShip2_orange.png"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"laserGreen06.png",
|
||||||
|
"laserBlue06.png"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"laserBlue16.png"
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
private var prices:Array<Array<Int>> = [
|
||||||
|
[
|
||||||
|
50000,
|
||||||
|
50000,
|
||||||
|
50000
|
||||||
|
],
|
||||||
|
[
|
||||||
|
100000,
|
||||||
|
100000,
|
||||||
|
100000
|
||||||
|
],
|
||||||
|
[
|
||||||
|
150000,
|
||||||
|
150000,
|
||||||
|
150000
|
||||||
|
],
|
||||||
|
[
|
||||||
|
50000,
|
||||||
|
100000
|
||||||
|
],
|
||||||
|
[
|
||||||
|
150000
|
||||||
|
]
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
24
src/StoreScene.hx
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
import com.haxepunk.Scene;
|
||||||
|
import com.haxepunk.graphics.Backdrop;
|
||||||
|
import com.haxepunk.HXP;
|
||||||
|
|
||||||
|
import StoreItem;
|
||||||
|
|
||||||
|
class StoreScene extends Scene {
|
||||||
|
|
||||||
|
public override function begin() {
|
||||||
|
backdrop = new Backdrop("graphics/darkPurple.png", true, true);
|
||||||
|
addGraphic(backdrop);
|
||||||
|
|
||||||
|
for (i in 0...StoreItem.itemnames.length) {
|
||||||
|
add(new StoreItem(HXP.halfWidth, 200 + (i * 200), i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override function update() {
|
||||||
|
super.update();
|
||||||
|
backdrop.y += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private var backdrop:Backdrop;
|
||||||
|
}
|