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

#1 2012-05-11 10:41:24

PPJB
New Scratcher
Registered: 2012-04-09
Posts: 24

Player Select?

Hi.

I'm making a project: a penalty (soccer) shoot out game, but I want to include the "Player select" option. I will begin with 2 characters, but later a want to include 32 characters (I want to remix this project in a World Cup themed one later). How can I do it?

P.S.: Sorry for my bad English ehhhhh.

Offline

 

#2 2012-05-11 12:43:51

PhirripSyrrip
Scratcher
Registered: 2012-02-11
Posts: 100+

Re: Player Select?

You can either do this by toggling the player with the arrow keys, or you can make a whole menu (like the character select in Super Smash bros Brawl here. Toggling with the arrows would be easier and quicker. The SSBB type selection would involve making many sprites as buttons (it is possible to do a 1s1s version of this but it would be hard). This would take long, especially in the 32 player one.


http://i46.tinypic.com/ao03lk.png

Offline

 

#3 2012-05-11 12:48:17

PhirripSyrrip
Scratcher
Registered: 2012-02-11
Posts: 100+

Re: Player Select?

For the buttons, make a button then add a script like this:

when clicked
forever
if
mouse down?
and
touching
mouse-pointer
?
wait until
not
mouse down?
if
touching
mouse-pointer
?
set
player
to
1

for the player:
switch to costume
player

for the toggling:
forever
if
key
left arrow
pressed?
change
toggle
by
-1
if
key
right arrow
pressed?
change
toggle
by
1
switch to costume
toggle

Last edited by PhirripSyrrip (2012-05-11 13:06:13)


http://i46.tinypic.com/ao03lk.png

Offline

 

#4 2012-05-11 14:20:41

PPJB
New Scratcher
Registered: 2012-04-09
Posts: 24

Re: Player Select?

Oh, thanks! I will give you credits in my game. _meow_ For another problem with this project, I will be posting there!

Offline

 

#5 2012-08-20 16:18:24

HeyHeyBoom
Scratcher
Registered: 2011-04-01
Posts: 32

Re: Player Select?

Here's an idea that takes a lot of objects and a lot of time... o_0

For a title bar:

when clicked
go to x:
0
y:
136
when clicked
go to front

For the scroll bar:
when clicked
go to x:
233
y:
0
when clicked
forever
go to front
optional
when
up arrow
key pressed
point in direction
0
repeat until
not
key
up arrow
pressed?
move
1
steps
when
down arrow
key pressed
point in direction
180
repeat until
not
key
down arrow
pressed?
move
1
steps

For the options:
when clicked
go to front
set
ghost
effect to
0
forever
go to x:
abs
of
y position
+
10
/
4
-
30
y:
y position
of
Scroller
for the second, third, etc. options, - 13, - 26, etc...
set
ghost
effect to
distance to
middle
when
space
key pressed
broadcast
Option Example Selected

Then make an object called 'middle', put it at x: 0, y: 0, make it 480×26, and hide it.

Then you're finished!

Last edited by HeyHeyBoom (2012-08-20 16:27:28)


Finn! -> ʕ₍∙⌄∙₎ʔ

Offline

 

#6 2012-08-20 18:21:25

PPJB
New Scratcher
Registered: 2012-04-09
Posts: 24

Re: Player Select?

Thanks! I already used the PhirripSyrrip's idea, but maybe I will use your idea for future games. Again, thanks a lot!

Offline

 

Board footer