This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-11-12 09:20:44

Dediaa
New Scratcher
Registered: 2011-11-12
Posts: 8

How to make level games

I need to know how to switch backgrounds,sprite etc

Offline

 

#2 2011-11-12 09:25:21

xXsprattyXx
New Scratcher
Registered: 2011-11-12
Posts: 7

Re: How to make level games

To swith backgrounds is quite simple  big_smile  All you need to do is create a new Stage and then add scripts to change the backgorund at certain points (Sending and recieving broadcasts) and to change the sprite you can just change the costume of the sprite by doing something like <when green flag clicked><switch to costume[  or something similar! Let me know if you need more help  big_smile

Offline

 

#3 2011-11-12 09:34:07

Dediaa
New Scratcher
Registered: 2011-11-12
Posts: 8

Re: How to make level games

I have made a button and when it is clicked I want it to go to the first level

Offline

 

#4 2011-11-12 09:35:12

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: How to make level games

There are two methods. Either:
When the player sprite teachers the end of the level, you broadcast 'level complete'. This sends a sort of message to all other sprites, so you could then put this on the stage:

When I receive 'level complete'
Next costume

The other way is to create a variable called 'level'. Make it so that when the player finishes the level, the variable changes by 1. You can now put this scripts for the stage:

When green flag clicked
Forever
If level = 1
Switch to costume 'level1
End if
If level = 2
Switch to costume 'level2'
End if

Of course, you would probably have more ifs than that (you need the same amount as the number of levels).

Or, to save having to put in loads of 'ifs', just put:

When green flag clicked
Forever
Switch to costume join level|'level'+1
End forever

In the join bit, the level inside the ' ' marks is the variable level, and the other you
Just write level. Just make sure you name the costumes 'level1' and 'level2'.


Why

Offline

 

#5 2011-11-12 09:42:43

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: How to make level games

Dediaa wrote:

I have made a button and when it is clicked I want it to go to the first level

Put this script on the button:

When button clicked
Broadcast start level 1

Then on the stage:

When I receive start level 1
Switch to costume level1


Why

Offline

 

#6 2011-11-12 10:01:50

Dediaa
New Scratcher
Registered: 2011-11-12
Posts: 8

Re: How to make level games

ok but how do you recieve a broadcast

Offline

 

#7 2011-11-12 10:10:50

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: How to make level games

Dediaa wrote:

ok but how do you recieve a broadcast

In the control category, there's a block shaped like the wheen green flag clicked, but called when I receive.


Why

Offline

 

#8 2011-11-12 10:18:22

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Re: How to make level games

RedRocker227 wrote:

There are two methods. Either:
When the player sprite teachers the end of the level, you broadcast 'level complete'. This sends a sort of message to all other sprites, so you could then put this on the stage:

When I receive 'level complete'
Next costume

The other way is to create a variable called 'level'. Make it so that when the player finishes the level, the variable changes by 1. You can now put this scripts for the stage:

When green flag clicked
Forever
If level = 1
Switch to costume 'level1
End if
If level = 2
Switch to costume 'level2'
End if

Of course, you would probably have more ifs than that (you need the same amount as the number of levels).

Or, to save having to put in loads of 'ifs', just put:

When green flag clicked
Forever
Switch to costume join level|'level'+1
End forever

In the join bit, the level inside the ' ' marks is the variable level, and the other you
Just write level. Just make sure you name the costumes 'level1' and 'level2'.

For a new scratcher, that's a lot of information. Keep posting like this, and you'll be a scratcher in no time!

Offline

 

#9 2011-11-12 10:41:01

Dediaa
New Scratcher
Registered: 2011-11-12
Posts: 8

Re: How to make level games

Thanks for all your help everyone

Offline

 

#10 2011-11-12 10:49:31

Dediaa
New Scratcher
Registered: 2011-11-12
Posts: 8

Re: How to make level games

im making a angry birds game. How do i get the bird to hit the blocks and pig

Offline

 

#11 2011-11-12 10:55:20

AmberBloss
New Scratcher
Registered: 2011-11-12
Posts: 6

Re: How to make level games

Dediaa wrote:

im making a angry birds game. How do i get the bird to hit the blocks and pig

Shoot it there?  smile

Offline

 

#12 2011-11-12 10:57:07

Dediaa
New Scratcher
Registered: 2011-11-12
Posts: 8

Re: How to make level games

ok but how will i shoot it there

Offline

 

#13 2011-11-12 13:18:44

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: How to make level games

owetre18 wrote:

RedRocker227 wrote:

There are two methods. Either:
When the player sprite teachers the end of the level, you broadcast 'level complete'. This sends a sort of message to all other sprites, so you could then put this on the stage:

When I receive 'level complete'
Next costume

The other way is to create a variable called 'level'. Make it so that when the player finishes the level, the variable changes by 1. You can now put this scripts for the stage:

When green flag clicked
Forever
If level = 1
Switch to costume 'level1
End if
If level = 2
Switch to costume 'level2'
End if

Of course, you would probably have more ifs than that (you need the same amount as the number of levels).

Or, to save having to put in loads of 'ifs', just put:

When green flag clicked
Forever
Switch to costume join level|'level'+1
End forever

In the join bit, the level inside the ' ' marks is the variable level, and the other you
Just write level. Just make sure you name the costumes 'level1' and 'level2'.

For a new scratcher, that's a lot of information. Keep posting like this, and you'll be a scratcher in no time!

Even though my status is New Scratcher, I've been using Scratch for over 6 months, I just didn't sign up until recently!


Why

Offline

 

#14 2011-11-12 13:47:58

Dediaa
New Scratcher
Registered: 2011-11-12
Posts: 8

Re: How to make level games

im making a angry birds game. How do i get the bird to hit the blocks and pig

How will I shoot it there.

Offline

 

#15 2011-11-12 14:43:17

schusteralex2
Scratcher
Registered: 2011-09-17
Posts: 1000+

Re: How to make level games

do you mean how to use the slingshot


http://i44.tinypic.com/2uj37ds.gif

Offline

 

#16 2011-11-12 15:12:20

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Re: How to make level games

RedRocker227 wrote:

owetre18 wrote:

RedRocker227 wrote:

There are two methods. Either:
When the player sprite teachers the end of the level, you broadcast 'level complete'. This sends a sort of message to all other sprites, so you could then put this on the stage:

When I receive 'level complete'
Next costume

The other way is to create a variable called 'level'. Make it so that when the player finishes the level, the variable changes by 1. You can now put this scripts for the stage:

When green flag clicked
Forever
If level = 1
Switch to costume 'level1
End if
If level = 2
Switch to costume 'level2'
End if

Of course, you would probably have more ifs than that (you need the same amount as the number of levels).

Or, to save having to put in loads of 'ifs', just put:

When green flag clicked
Forever
Switch to costume join level|'level'+1
End forever

In the join bit, the level inside the ' ' marks is the variable level, and the other you
Just write level. Just make sure you name the costumes 'level1' and 'level2'.

For a new scratcher, that's a lot of information. Keep posting like this, and you'll be a scratcher in no time!

Even though my status is New Scratcher, I've been using Scratch for over 6 months, I just didn't sign up until recently!

Oh, okay.  wink

Offline

 

#17 2011-11-12 16:16:57

Dediaa
New Scratcher
Registered: 2011-11-12
Posts: 8

Re: How to make level games

yes i men how to use thelingshot

Offline

 

#18 2011-11-12 17:19:21

schusteralex2
Scratcher
Registered: 2011-09-17
Posts: 1000+

Re: How to make level games

OK, then i think you would need to have a sprite for the slingshot band with a script of
If(band) clicked
if (mouse down)= true
go to mouse pointer
if mouse pointer x<maximum slingshot pull
go to maximum slingshot pull
if mousepointer x>minimum slingshot pull
go to minimum slingshot pull
then do the same with the Y
if  mousepointer down=false
go to starting position
broadcast shoot
I didnt put in the values because i did not know where your slingshot would be positioned


http://i44.tinypic.com/2uj37ds.gif

Offline

 

Board footer