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 gf clicked
forever
if <<mouse down?> and <touching [mouse-pointer v]?>>
wait until <not<mouse down?>>
if <touching [mouse-pointer v]?>
set [player v] to [1]
for the player:
switch to costume (player)
for the toggling:
forever
if <key [left arrow v] pressed?>
change [toggle v] by [-1]
end
if <key [right arrow v] pressed?>
change [toggle v] by [1]
end
switch to costume (toggle)
end

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 gf clicked
go to x: (0) y: (136)
when gf clicked 
go to front
For the scroll bar:
when gf clicked
go to x: (233) y: (0)
when gf clicked 
forever
go to front
(optional)
when [up arrow v] key pressed
point in direction (0)
repeat until <not <key [up arrow v] pressed?>>
  move (1) steps
end
when [down arrow v] key pressed
point in direction (180)
repeat until <not <key [down arrow v] pressed?>>
  move (1) steps
end

For the options:
when gf clicked
go to front
set [ghost v] effect to (0)
forever
  go to x: (((([abs v] of (y position)) + (10)) / (4)) - (30)) y: ([y position v] of [Scroller v])
(for the second, third, etc. options, - 13, - 26, etc...) 
  set [ghost v] effect to (distance to [middle v])
end
when [space v] key pressed
  broadcast [Option Example Selected v]
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