Game Over Menu #1

6 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€93.07
List Price:  €130.30
You save:  €37.23
£79.62
List Price:  £111.47
You save:  £31.85
CA$136.60
List Price:  CA$191.24
You save:  CA$54.64
A$151.87
List Price:  A$212.63
You save:  A$60.75
S$135.20
List Price:  S$189.29
You save:  S$54.08
HK$781.33
List Price:  HK$1,093.90
You save:  HK$312.56
CHF 90.72
List Price:  CHF 127.01
You save:  CHF 36.29
NOK kr1,092.46
List Price:  NOK kr1,529.50
You save:  NOK kr437.03
DKK kr694.20
List Price:  DKK kr971.90
You save:  DKK kr277.70
NZ$167.15
List Price:  NZ$234.02
You save:  NZ$66.86
د.إ367.25
List Price:  د.إ514.16
You save:  د.إ146.91
৳10,946.16
List Price:  ৳15,325.07
You save:  ৳4,378.90
₹8,342.71
List Price:  ₹11,680.13
You save:  ₹3,337.42
RM473.95
List Price:  RM663.55
You save:  RM189.60
₦123,487.65
List Price:  ₦172,887.65
You save:  ₦49,400
₨27,847.21
List Price:  ₨38,987.21
You save:  ₨11,140
฿3,679.53
List Price:  ฿5,151.49
You save:  ฿1,471.96
₺3,232.18
List Price:  ₺4,525.18
You save:  ₺1,293
B$511.10
List Price:  B$715.57
You save:  B$204.46
R1,851.52
List Price:  R2,592.21
You save:  R740.68
Лв181.98
List Price:  Лв254.78
You save:  Лв72.80
₩135,881.87
List Price:  ₩190,240.05
You save:  ₩54,358.18
₪371.60
List Price:  ₪520.25
You save:  ₪148.65
₱5,713.97
List Price:  ₱7,999.79
You save:  ₱2,285.82
¥15,308.41
List Price:  ¥21,432.39
You save:  ¥6,123.98
MX$1,693.57
List Price:  MX$2,371.07
You save:  MX$677.49
QR364.01
List Price:  QR509.63
You save:  QR145.62
P1,365.33
List Price:  P1,911.52
You save:  P546.18
KSh13,468.65
List Price:  KSh18,856.65
You save:  KSh5,388
E£4,794.02
List Price:  E£6,711.82
You save:  E£1,917.80
ብር5,699.43
List Price:  ብር7,979.43
You save:  ብር2,280
Kz83,741.62
List Price:  Kz117,241.62
You save:  Kz33,500
CLP$94,755.52
List Price:  CLP$132,661.52
You save:  CLP$37,906
CN¥723.62
List Price:  CN¥1,013.10
You save:  CN¥289.48
RD$5,785.38
List Price:  RD$8,099.76
You save:  RD$2,314.38
DA13,457.99
List Price:  DA18,841.73
You save:  DA5,383.73
FJ$225.30
List Price:  FJ$315.43
You save:  FJ$90.13
Q775.21
List Price:  Q1,085.33
You save:  Q310.11
GY$20,876.73
List Price:  GY$29,228.26
You save:  GY$8,351.52
ISK kr13,989.60
List Price:  ISK kr19,586
You save:  ISK kr5,596.40
DH1,008.69
List Price:  DH1,412.20
You save:  DH403.51
L1,771.31
List Price:  L2,479.90
You save:  L708.59
ден5,730.13
List Price:  ден8,022.42
You save:  ден2,292.28
MOP$803.11
List Price:  MOP$1,124.38
You save:  MOP$321.27
N$1,860.85
List Price:  N$2,605.27
You save:  N$744.41
C$3,673.63
List Price:  C$5,143.23
You save:  C$1,469.60
रु13,311.40
List Price:  रु18,636.50
You save:  रु5,325.09
S/375.46
List Price:  S/525.66
You save:  S/150.20
K383.63
List Price:  K537.10
You save:  K153.47
SAR375.03
List Price:  SAR525.05
You save:  SAR150.02
ZK2,685.42
List Price:  ZK3,759.69
You save:  ZK1,074.27
L463.14
List Price:  L648.42
You save:  L185.27
Kč2,328.17
List Price:  Kč3,259.54
You save:  Kč931.36
Ft36,248.95
List Price:  Ft50,749.98
You save:  Ft14,501.03
SEK kr1,083.98
List Price:  SEK kr1,517.62
You save:  SEK kr433.63
ARS$87,816.53
List Price:  ARS$122,946.66
You save:  ARS$35,130.12
Bs689.12
List Price:  Bs964.79
You save:  Bs275.67
COP$389,940.87
List Price:  COP$545,932.82
You save:  COP$155,991.94
₡50,893.45
List Price:  ₡71,252.86
You save:  ₡20,359.41
L2,475.75
List Price:  L3,466.15
You save:  L990.40
₲747,391.81
List Price:  ₲1,046,378.43
You save:  ₲298,986.62
$U3,833.15
List Price:  $U5,366.56
You save:  $U1,533.41
zł402.67
List Price:  zł563.75
You save:  zł161.08
Already have an account? Log In

Transcript

Hello everybody in this video Our goal is to make it so our game over menu appears whenever time runs out. So the way we're going to do this is by working inside of our BP game mode game play blueprints of find your way on over to this directory, and then double click on your game of gameplay to open it up. For starters, we want some music to play whenever the game over menu appears. So let's do like we did before and add an audio component. So I'm going to firstly select my default scene route here. And it doesn't really matter if this is attached to the default scene route or not because this is simply going to be triggering some music.

I'm going to click my green Add Component button, choose an audio component and I will call this music underscore game over and with that Selected over in the Details panel, the sound that I am going to slot in for this is going to be V r underscore ship. I'm looking for ship scale down o to Q. Now if you highlight this one, you can see that the path for this is in your engine content folders. So you should all have access to this. Now it doesn't really matter which sound you slot in. But this one I thought was decently appropriate for a game over type of sound.

Again, you probably want a little music ditty here but this is going to serve our purposes for now. And with that slotted in, we need to slide on down in the Details panel and this is something that you should make sure that you do for all your different audio components here and I didn't do that right away for our music, game component. Auto activate we want to make sure that this is checked off and it should be off for the rest These as well, because through scripting, we are going to tell this when we do want it to play. Okay, so that's gonna be all we want to do here. Let's jump on over to your Event Graph. And where we've got this level complete script, let's work right beneath here, because the first thing that we're gonna do is we're gonna left click actually, and we're going to drag out a marquee selection, we're going to grab this whole level complete section of script.

And I'm going to hit Ctrl C to copy and then down below, I'm going to hit Ctrl V to paste we're going to take a little bit of a shortcut here. Now, you're going to see this warning here because we need a unique Custom Event. You can't have two copies of the same Custom Event. So you can select this custom event and we're going to rename this custom event, a custom event to be Game over. And I'm typing this over in the Details panel. And if I want to make this warning go away, you can simply compile and that will get rid of it.

And obviously, this comment block is not represent representative of what we want this to be called. I'm going to call this whole comment block, game over. Now up above, just letting you know how this is all constructed. We've got our level complete script right up above. And we've got our game over script down below. And the only thing we've changed so far is the name of our custom event.

We've changed the game over, but there is more we need to change in here. Namely, if we scroll on over to the right, we got to make sure that the widgets that we show when the game is over is not the level complete widget we need this to be the game over menu and then if we slow on over to the right. We're going to fade out our game music. But we don't want to play our level complete music. Instead, we want to delete this out and drag and drop in our music game over and you can drag and drop this right on top of this pin like so. And that'll do just fine there.

And that should be all we need to do right there. So with that done, you can Compile and Save. Now, we did create this custom event for Game Over but there is currently nothing calling this there's nothing to actually fire off this event. So what we need to do is jump on over into our functions over here, and we've got this decrement timer function that we created earlier. If you double click on this guy, this is where we were decrementing our game time. And what we want to do is we want to say that if our game time limit equal zero that is Time's up.

That is true, then we want to call Game Over, call function game over. Okay. So with that let's Compile and Save. And now I should be able to jump in and play to test this out. But I'm gonna take a little bit of a shortcut I see I don't want to wait 120 seconds to have our game over menu appear. So what I'm going to do is jump over to level one time limit this variable right here, I'm going to change our level a one time limit to be five, five seconds.

And also note too that I am not starting from our main menu I am starting from level one that is currently the level you see here. So if I click play from here, I'm just going to launch directly into level one instead of going through my start menu. So here we go. hit play 5432 and one and you heard my quote unquote Game Over music they're more like a sound effect and our game music did cut out so everything is working as intended here in terms of the game over menu showing up but you will notice that these buttons do not yet function so that is to come in the next video but Mission accomplished. For this video. We will see you guys in the next one

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.