Skip to content

Commit

Permalink
Revert "Update win.wav and GameState.hx"
Browse files Browse the repository at this point in the history
This reverts commit bc0f276.
  • Loading branch information
gamemake-eng committed Mar 9, 2023
1 parent 3bd305f commit d4a415f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<!--<haxelib name="flixel-addons" />-->

<!--In case you want to use the ui package-->
<haxelib name="flixel-ui" />-
<!--<haxelib name="flixel-ui" />-->

<!--In case you want to use nape with flixel-->
<!--<haxelib name="nape-haxe4" />-->
Expand Down
Binary file added assets/images/ps4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 18 additions & 1 deletion source/InstructionsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import flixel.FlxSprite;
import flixel.text.FlxText;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.util.FlxTimer;
import flixel.input.gamepad.FlxGamepad;

class InstructionsState extends FlxState {

Expand All @@ -17,14 +18,21 @@ class InstructionsState extends FlxState {
{
super.create();

var gamepad:FlxGamepad = FlxG.gamepads.lastActive;

e = new FlxSprite(0,0);
e.frames = FlxAtlasFrames.fromSparrow('assets/images/door.png', 'assets/images/door.xml');
e.animation.addByPrefix('doorshut', 'doorshut', 24, false);
e.animation.play("doorshut");
add(e);

doors = new FlxSprite(0,0);
doors.loadGraphic("assets/images/Mouse_Left_Key_Dark.png");
if (gamepad == null) {
doors.loadGraphic("assets/images/Mouse_Left_Key_Dark.png");
}else {
doors.loadGraphic("assets/images/ps4.png");
}

doors.screenCenter();
doors.y -= 60;
add(doors);
Expand All @@ -45,6 +53,15 @@ class InstructionsState extends FlxState {
{
super.update(elapsed);

var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
if (gamepad == null) {
doors.loadGraphic("assets/images/Mouse_Left_Key_Dark.png");
}else {
doors.loadGraphic("assets/images/ps4.png");
}

doors.screenCenter();
doors.y -= 60;

}
}
12 changes: 10 additions & 2 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,27 @@ import flixel.FlxG;
import flixel.FlxSprite;
import flixel.text.FlxText;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.input.gamepad.FlxGamepad;

class PlayState extends FlxState
{
var doors:FlxSprite;
var text2:FlxText;
var textsus:FlxText;
override public function create()
{
super.create();

doors = new FlxSprite(0,0);
doors.frames = FlxAtlasFrames.fromSparrow('assets/images/door.png', 'assets/images/door.xml');
doors.animation.addByPrefix('doorshut', 'doorshut', 24, false);
doors.animation.play("doorshut");
add(doors);

textsus = new FlxText(0,0,0,"If on controller, press X",20);

add(textsus);

text2 = new FlxText(0,0,0,"Click to start",50);
text2.screenCenter();
add(text2);
Expand All @@ -28,9 +35,10 @@ class PlayState extends FlxState
override public function update(elapsed:Float)
{
super.update(elapsed);
if (FlxG.mouse.pressed) {
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;

if (FlxG.mouse.pressed || (gamepad != null && gamepad.justPressed.A)) {
FlxG.switchState(new InstructionsState());
}

}
}

0 comments on commit d4a415f

Please # to comment.