Skip to content

Commit

Permalink
Death Screen Edit
Browse files Browse the repository at this point in the history
  • Loading branch information
ZafeerA123 committed Nov 3, 2023
1 parent 525f58f commit 7181e9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions _posts/2023-10-31-MiniGametest5.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ var characterYSpeed = 0; // Vertical speed of the character
var deathObject = new Object("death", deathSpriteSheet, [24,54],[54,133],[0,1500],23,1);
var showdeathObject = false;

//Death Screen
var deathScreen = new Image ();
deathScreen.src = "/Group/images/Game/Death(1).png";
var DeathScreenObject = new Object ("Death Screen Object", DeathScreenObject, [2000, 250],[54,133],[0,1500],8,1)

//character death fade
var fadeSpriteSheet = new Image();
fadeSpriteSheet.src = "/Group/images/Game/deathscreenfade-sprite.png";
Expand Down Expand Up @@ -164,7 +169,7 @@ function startElevatorAnimation() {

//text

var display = new subDisplay(canvas,[windowObject1,windowObject2,windowObject3,windowObject4,windowObject5,backgroundObject,elevatorObject,myCharacterObject,monsterObject,fadeObject,deathObject]);
var display = new subDisplay(canvas,[windowObject1,windowObject2,windowObject3,windowObject4,windowObject5,backgroundObject,elevatorObject,myCharacterObject,monsterObject,fadeObject,deathObject,DeathScreenObject]);

var fps = 22;
var active = true;
Expand Down Expand Up @@ -231,6 +236,8 @@ function deathAnimation(){
}
//draw the death fade
fadeObject.UpdateFrame()
//Draw death screen
DeathScreenObject.UpdateFrame()

var characterPosition = myCharacterObject.ReturnPosition();
deathObject.OverridePosition([characterPosition[0] + 23, characterPosition[1]]); // Adjust the position
Expand Down Expand Up @@ -295,7 +302,7 @@ function frame(){ //when a frame is updated
showCharacter = false;
active = false;
animationFrame = 0;
display.objects = [windowObject1,windowObject2,windowObject3,windowObject4,windowObject5,backgroundObject,elevatorObject,monsterObject,fadeObject,deathObject]
display.objects = [windowObject1,windowObject2,windowObject3,windowObject4,windowObject5,backgroundObject,elevatorObject,monsterObject,fadeObject,deathObject,DeathScreenObject]
deathAnimation();
}
// check for overlap between character and elevator
Expand Down
Binary file added images/Game/Death(1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7181e9e

Please sign in to comment.