diff --git a/assets/graphics/laserBlue01.png b/assets/graphics/laserBlue01.png new file mode 100644 index 0000000..b76aaf7 Binary files /dev/null and b/assets/graphics/laserBlue01.png differ diff --git a/assets/graphics/laserBlue02.png b/assets/graphics/laserBlue02.png new file mode 100644 index 0000000..3f923a3 Binary files /dev/null and b/assets/graphics/laserBlue02.png differ diff --git a/assets/graphics/laserBlue03.png b/assets/graphics/laserBlue03.png new file mode 100644 index 0000000..a16e9a8 Binary files /dev/null and b/assets/graphics/laserBlue03.png differ diff --git a/assets/graphics/laserBlue04.png b/assets/graphics/laserBlue04.png new file mode 100644 index 0000000..6f3b910 Binary files /dev/null and b/assets/graphics/laserBlue04.png differ diff --git a/assets/graphics/laserBlue05.png b/assets/graphics/laserBlue05.png new file mode 100644 index 0000000..85cff7d Binary files /dev/null and b/assets/graphics/laserBlue05.png differ diff --git a/assets/graphics/laserBlue06.png b/assets/graphics/laserBlue06.png new file mode 100644 index 0000000..a621875 Binary files /dev/null and b/assets/graphics/laserBlue06.png differ diff --git a/assets/graphics/laserBlue07.png b/assets/graphics/laserBlue07.png new file mode 100644 index 0000000..e1848bf Binary files /dev/null and b/assets/graphics/laserBlue07.png differ diff --git a/assets/graphics/laserBlue08.png b/assets/graphics/laserBlue08.png new file mode 100644 index 0000000..7a46396 Binary files /dev/null and b/assets/graphics/laserBlue08.png differ diff --git a/assets/graphics/laserBlue09.png b/assets/graphics/laserBlue09.png new file mode 100644 index 0000000..35624e6 Binary files /dev/null and b/assets/graphics/laserBlue09.png differ diff --git a/assets/graphics/laserBlue10.png b/assets/graphics/laserBlue10.png new file mode 100644 index 0000000..dd6b766 Binary files /dev/null and b/assets/graphics/laserBlue10.png differ diff --git a/assets/graphics/laserBlue11.png b/assets/graphics/laserBlue11.png new file mode 100644 index 0000000..c062349 Binary files /dev/null and b/assets/graphics/laserBlue11.png differ diff --git a/assets/graphics/laserBlue12.png b/assets/graphics/laserBlue12.png new file mode 100644 index 0000000..48b6103 Binary files /dev/null and b/assets/graphics/laserBlue12.png differ diff --git a/assets/graphics/laserBlue13.png b/assets/graphics/laserBlue13.png new file mode 100644 index 0000000..c5ec6a3 Binary files /dev/null and b/assets/graphics/laserBlue13.png differ diff --git a/assets/graphics/laserBlue14.png b/assets/graphics/laserBlue14.png new file mode 100644 index 0000000..254601e Binary files /dev/null and b/assets/graphics/laserBlue14.png differ diff --git a/assets/graphics/laserBlue15.png b/assets/graphics/laserBlue15.png new file mode 100644 index 0000000..1ea1966 Binary files /dev/null and b/assets/graphics/laserBlue15.png differ diff --git a/assets/graphics/laserBlue16.png b/assets/graphics/laserBlue16.png new file mode 100644 index 0000000..1def98f Binary files /dev/null and b/assets/graphics/laserBlue16.png differ diff --git a/assets/graphics/playerShip1_blue.png b/assets/graphics/playerShip1_blue.png new file mode 100644 index 0000000..cecbbed Binary files /dev/null and b/assets/graphics/playerShip1_blue.png differ diff --git a/assets/graphics/playerShip1_orange.png b/assets/graphics/playerShip1_orange.png new file mode 100644 index 0000000..3902283 Binary files /dev/null and b/assets/graphics/playerShip1_orange.png differ diff --git a/assets/graphics/playerShip1_red.png b/assets/graphics/playerShip1_red.png new file mode 100644 index 0000000..3695e09 Binary files /dev/null and b/assets/graphics/playerShip1_red.png differ diff --git a/assets/graphics/playerShip2_blue.png b/assets/graphics/playerShip2_blue.png new file mode 100644 index 0000000..e277114 Binary files /dev/null and b/assets/graphics/playerShip2_blue.png differ diff --git a/assets/graphics/playerShip2_green.png b/assets/graphics/playerShip2_green.png new file mode 100644 index 0000000..72e18c7 Binary files /dev/null and b/assets/graphics/playerShip2_green.png differ diff --git a/assets/graphics/playerShip2_orange.png b/assets/graphics/playerShip2_orange.png new file mode 100644 index 0000000..82ddc80 Binary files /dev/null and b/assets/graphics/playerShip2_orange.png differ diff --git a/assets/graphics/playerShip2_red.png b/assets/graphics/playerShip2_red.png new file mode 100644 index 0000000..8213e97 Binary files /dev/null and b/assets/graphics/playerShip2_red.png differ diff --git a/assets/graphics/playerShip3_blue.png b/assets/graphics/playerShip3_blue.png new file mode 100644 index 0000000..f34faf0 Binary files /dev/null and b/assets/graphics/playerShip3_blue.png differ diff --git a/assets/graphics/playerShip3_green.png b/assets/graphics/playerShip3_green.png new file mode 100644 index 0000000..b853be4 Binary files /dev/null and b/assets/graphics/playerShip3_green.png differ diff --git a/assets/graphics/playerShip3_orange.png b/assets/graphics/playerShip3_orange.png new file mode 100644 index 0000000..0b6b7ec Binary files /dev/null and b/assets/graphics/playerShip3_orange.png differ diff --git a/assets/graphics/playerShip3_red.png b/assets/graphics/playerShip3_red.png new file mode 100644 index 0000000..796e81d Binary files /dev/null and b/assets/graphics/playerShip3_red.png differ diff --git a/src/Bullet.hx b/src/Bullet.hx index a587603..a8b75cd 100644 --- a/src/Bullet.hx +++ b/src/Bullet.hx @@ -7,12 +7,12 @@ class Bullet extends Entity { public function new(x:Float, y:Float) { super(x, y); - laser1 = new Image("graphics/laserGreen09.png"); - laser2 = new Image("graphics/laserGreen13.png"); + laser1 = new Image("graphics/laserGreen04.png"); + laser2 = new Image("graphics/laserGreen12.png"); graphic = laser1; - setHitbox(9, 37); + setHitboxTo(laser1); type = "bullet"; diff --git a/src/Main.hx b/src/Main.hx index a6adea7..d9b07b2 100644 --- a/src/Main.hx +++ b/src/Main.hx @@ -15,8 +15,7 @@ class Main extends Engine HXP.resize(360, 640); #end - // HXP.scene = new MainScene(); - HXP.scene = new MenuScene(); + HXP.scene = new StoreScene(); } public static function main() { new Main(); } diff --git a/src/StoreItem.hx b/src/StoreItem.hx new file mode 100644 index 0000000..23117d7 --- /dev/null +++ b/src/StoreItem.hx @@ -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 = []; + private var arrowLeft:Image; + private var arrowRight:Image; + + private var text:Text; + + public static var itemnames:Array = [ + "Fat Jumper", + "Speeder Jumper", + "X3 Jumper", + "V2 Laser", + "Heavy Laser" + ]; + + private var items:Array> = [ + [ + "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> = [ + [ + 50000, + 50000, + 50000 + ], + [ + 100000, + 100000, + 100000 + ], + [ + 150000, + 150000, + 150000 + ], + [ + 50000, + 100000 + ], + [ + 150000 + ] + + ]; + + + +} \ No newline at end of file diff --git a/src/StoreScene.hx b/src/StoreScene.hx new file mode 100644 index 0000000..e1d5cdc --- /dev/null +++ b/src/StoreScene.hx @@ -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; +} \ No newline at end of file