Hey guys!
I have been trying to make a game for school.To make it more fun Im trying to make a main menu.i have been using a sprite to do this its just a red button.Please tell me how to make that button change the backround to backround 2. Thx!
Offline
Give it the script:
when button clicked
broadcast [next background v]
and on the background
when gf clicked
switch to background background 1
when I recieve [next background v]
switch to background background 2
Offline
What you need to do is go to the scripts for the red button. Then make the script:
when [Red Button] clicked broadcast [Go To Background 2 v]Now go to the Stage's scripts and do:
when I receive [Go To Background 2 v] switch to background [background 2 v]I wasn't able to do this when I made one of my first projects.
Last edited by EH7meow (2013-04-23 13:32:36)
Offline
SirSmurfie wrote:
Hey guys!
I have been trying to make a game for school.To make it more fun Im trying to make a main menu.i have been using a sprite to do this its just a red button.Please tell me how to make that button change the backround to backround 2. Thx!
Here is what you can do. Lets say that you are in play mode.
when I receive [play] go to x[-160], y[-143] show end when Menu button clicked broadcast [main menu] hideThere is no such thing as when--- clicked in red blocks.
Last edited by joshuaho (2013-04-16 16:21:04)
Offline
joshuaho wrote:
SirSmurfie wrote:
Hey guys!
I have been trying to make a game for school.To make it more fun Im trying to make a main menu.i have been using a sprite to do this its just a red button.Please tell me how to make that button change the backround to backround 2. Thx!Here is what you can do. Lets say that you are in play mode.
when I receive [play v] go to x:[-160] y:[-143] show end when [Menu button] clicked broadcast [main menu v] hideThere is no such thing as when--- clicked in red blocks.
But you can find a when --- clicked block in the yellow control blocks.
Fixed You missed some syntax
With regards
7734f
Offline
7734f wrote:
joshuaho wrote:
SirSmurfie wrote:
Hey guys!
I have been trying to make a game for school.To make it more fun Im trying to make a main menu.i have been using a sprite to do this its just a red button.Please tell me how to make that button change the backround to backround 2. Thx!Here is what you can do. Lets say that you are in play mode.
when I receive [play v] go to x:[-160] y:[-143] show end when [Menu button] clicked broadcast [main menu v] hideThere is no such thing as when--- clicked in red blocks.
But you can find a when --- clicked block in the yellow control blocks.Fixed You missed some syntax
With regards
7734f
Thanks.
Offline
Play Sprite:
When gf clicked show when i receive [show buttons] show when I am clicked broadcast [playbuttonclicked v] hideStage:
when gf clicked switch to background [titlescreen v] when i receive [helpscreen] switch to background [helpscreen] wait (10) secs. broadcast [show buttons] switch to background [titlescreen] when i receive [play] switch to background [play]Help Button:
when gf clicked show [/SCRATCHBOLCKS] [SCRATCHBLOCKS] when I am clicked broadcast [help] hide when i receive [show buttons] showOh......... the red when i am clicked is a new script.
Offline