Need help with Gameover scene please? :)
allc1865
Member, PRO Posts: 777
Hello everyone! I need help with my gameover scene When my actor dies, the game over picture comes up, but only in one area. I wanted it to show up wherever the player is. Also, when the game over scene shows up, you can still use the controls to shoot and move, even though the actor has been destroyed. Any help would be appreciated! Thanks
Here's the link to my template:
https://www.dropbox.com/s/bicm3ervqd8ho3f/GameOver scene Template.zip
Here's the link to my template:
https://www.dropbox.com/s/bicm3ervqd8ho3f/GameOver scene Template.zip
Best Answers
-
-Timo- Posts: 2,313make a boolean attribute.
if game.boolean is false
do everything so you can move.
if player dies
do change game.boolean to true (so you cant move anymore)
something like that hope this helped -
-Timo- Posts: 2,313I think it has already been suggested by someone else but:
place the game over actor in a non scrollable layer and put his alpha to 0
if game.health is 0 do change self.color.alpha to 1
(now you wont need the change rotation to 0) -
KillerPenguinStudios Posts: 1,291@allc1865, I sent you a message with details on everything I did to get it working for you as well as notes in the project. Let me know how that works out for you!
-
-Timo- Posts: 2,313
you sure?I think it has already been suggested by someone else but:
If it is in a non scrollable layer then it wont work properly.
place the game over actor in a non scrollable layer and put his alpha to 0
if game.health is 0 do change self.color.alpha to 1
(now you wont need the change rotation to 0)
I made a little template https://www.dropbox.com/sh/yh38ojjbize1aqd/9A_E9p4-4O
Answers
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
I always open the wrong project for some reason. I don't know why. maybe I am just stupid?
you probably wont believe it but I just went to my windows xD I will look at it when I am on mac and when my homework is done... (and my sister is now on mac )
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
In this case, my guess is that you have set the position of the game over actor to relative to scene instead of relative to actor, but I won't know for sure until I see your rule.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
you are spawning the game over actor relative to scene. just change this the position offset to X = 0 and
Y = 0 and relative to scene.
you also want to put the behavior change self.rotation to 0 inside the game over actor
PS when you download the project on windows its a windows project. when you download on mac its and mac project. just noticed that and this wasnt before not sure if this also works backwards
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
Right now, where ever the player is, that's where the menu shows up as shown below:
It is over in the right hand side of the screen where the actor was instead of centered; how I want it to be
Here's my actor player rules:
....
and here's the rules for my game over actor:
Thanks, everyone!
@timolapre1998, thanks for your help, that worked!
@KillerPenguinStudios, hi, thanks for the reply. That is a good idea, however I think I would run into one problem which what I'm having trouble with now, getting my game over picture to be centered Thanks!
you have to make a integer attribute.
when player dies
do
pause game (scene game over)
when player menu is pressed change integer to 1
unpause game.
when retry button is pressed change integer to 2
inside the player (or something else inside the play scene)
if integer is 1 change scene to menu
if integer is 2 reset scene.
hope this helps
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
self.position.X = game.Screen.Size.Width / 2
And it's the same vertically:
self.position.Y = game.Screen.Size.Height / 2
your player is always in the middle and you have in the player if health = 0 spawn actor game over. so then he is in the middle?
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
you just have to play wth the values though.
if player health = 0
do
spawn actor, menu button
x -200 y -100 relative to actor
spawn actor retry button
x 200 y -100 relative to scene
and just in the buttons what you want to do.
if touch is pressed go to menu or restart scene
hope this helped
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
And yes I was referring to change attributes in my example above. Those two change attributes would go on the game over actor when it's spawned or you could just put the second part of each (the game.Screen.Size.Height & Width part) on the Spawn Actor behavior, depending on what spawns the game over actor.
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
Well if you are controlling the camera try this. Have your game over image in your scene somewhere where it's not seen during gameplay.
In the game over attribute, give it a Start X and Start Y integer.
Tell the object to change Start X to self.position.X
and Change Start Y to self.position.Y
(This next part must be done by unlocking the actor in the scene)
In a rule: When game over is true
Change self.position.X to camera X
Change self.position.Y to camera Y
Otherwise:
Change self.position.X to Start X
Change self.position.Y to Start Y
This is just a thought off the top of my head as I am not 100% sure how your game works! Let me know how that goes!
I went into the attributes panel (not the attributes in the actor itself) and made two integer attributes called Start X and Start Y. I went into the gameOver actor and said change attribute > game.Start X to self.Position.X
Then I made another change attribute and said > game.Start Y > self.Position.Y
Then I went into the gameOver actor in the scene - unlocked it and said > Rule > when game.GameOver is true > change attribute self.Position.X to scene.Camera.Origin.X;
change attribute > self.Position.Y to scene.Camera.Origin.Y
otherwise > change attribute > self.Position.X to game.Start X;
change attribute > self.Position.Y to game.Start Y.
Is that right?
Thanks
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I think that's why my gameOver image shows up wherever my actor is...
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮