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

#1 2012-12-12 22:17:34

X360GLaDOS
Scratcher
Registered: 2012-10-10
Posts: 2

Start button and levels?

Hello,

I am trying to make a simple 2-D platformer, and I don't know how to make a working start button, or make it when the button is pressed, the levels show up. Also, when a player finishes a level, how do I get it to go to the next level?  hmm

Showing me a few relevant scripts for platformers would be greatly appreciated.  smile

Sincerely,

X360GLaDOS

Offline

 

#2 2012-12-13 16:00:36

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Start button and levels?

X360GLaDOS wrote:

Hello,

I am trying to make a simple 2-D platformer, and I don't know how to make a working start button, or make it when the button is pressed, the levels show up. Also, when a player finishes a level, how do I get it to go to the next level?  hmm

Showing me a few relevant scripts for platformers would be greatly appreciated.  smile

Sincerely,

X360GLaDOS

First of all, hello X360GLaDOS and welcome to Scratch!

Secondly, when asking a question, you're supposed to make a new topic about it, not post it on existing topic, unless your question is relevant.

Moving on, about your second question, you could use this in your main character:

when gf clicked
set [level v] to (0)
forever
 if (touching [goal v]?)
  change [level v] by (1)
  broadcast [new level v] and wait
 end

And for the other sprites, just use the "new level" broadcast to set them for the next level.

Now for your first question. You'll need this in your button:

when gf clicked
hide

Now you'll need to use either, but not both, of these in your button:

when [button v] clicked//A bit slower.
set [level v] to (1)
hide
broadcast [new level v] and wait
When gf clicked//A bit faster.
forever
 if <(touching [mouse pointer v]?) and (mouse down?)>
  set [level v] to (1)
  hide
  broadcast [new level v] and wait
 end

I hope that this helps!

Last edited by ErnieParke (2012-12-13 20:11:07)


http://i46.tinypic.com/35ismmc.png

Offline

 

#3 2012-12-13 19:55:36

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Start button and levels?

I'll break it out into it's own topic  smile


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#4 2012-12-13 20:44:08

mmww
Scratcher
Registered: 2010-01-14
Posts: 500+

Re: Start button and levels?

If you just want to make it where your other sprites begin responding when its clicked put:

when [sprite1] clicked
broadcast [start v]
Then after you finish, program it where it all starts with when i recieve start


http://i.imgur.com/AWFFO.pnghttp://www.weebly.com/uploads/1/0/1/4/10146167/4363061_orig.png Save the cheese!
I am http://blocks.scratchr.org/API.php?action=onlineStatus&amp;user=mmww

Offline

 

#5 2012-12-21 13:44:20

iEcoWarrioR
New Scratcher
Registered: 2012-12-18
Posts: 20

Re: Start button and levels?

download my mouse maze v.1.1 there is a startbutton and levels in, so you can see how I solved that  tongue

Offline

 

Board footer