Discuss Scratch

stmbbg
Scratcher
19 posts

HOW TO MAKE A 2 players selcetion screen?

Am making a 2 player fighting game how would I make a selecting screen were both players can chose there characters before they fight?
stmbbg
Scratcher
19 posts

HOW TO MAKE A 2 players selcetion screen?

bump
Birdlegs
Scratcher
1000+ posts

HOW TO MAKE A 2 players selcetion screen?

I would either have players take turns choosing, or use different keys on the keyboard to select the fighter for each player. Good luck!
WolfCat67
Scratcher
1000+ posts

HOW TO MAKE A 2 players selcetion screen?

This may seem like self-advertisement, but I have a sequence for my game Smiley Fighters that has both of the buttons on the same screen, one for each player.
stmbbg
Scratcher
19 posts

HOW TO MAKE A 2 players selcetion screen?

JoeyTheChicken wrote:

I would either have players take turns choosing, or use different keys on the keyboard to select the fighter for each player. Good luck!
But how would I do that?
adas2005
Scratcher
34 posts

HOW TO MAKE A 2 players selcetion screen?

whenclickedsetselecterto1broadcastselectandwaitsetselecterto2broadcastselect

This is sort of the first script you would use, I can't make the rest because it'll be confusing for me.
so I'll explain:
After (select) is broadcasted, it then needs to check if (selecter) is the same as 1.
if so, it will wait untill the choice is clicked which it will save in a variable( maybe as a number)
if not, it will wait for for player 2's choice instead of ones choice.
If you want me to make a project with this script then ask me.
stmbbg
Scratcher
19 posts

HOW TO MAKE A 2 players selcetion screen?

adas2005 wrote:

whenclickedsetselecterto1broadcastselectandwaitsetselecterto2broadcastselect

This is sort of the first script you would use, I can't make the rest because it'll be confusing for me.
so I'll explain:
After (select) is broadcasted, it then needs to check if (selecter) is the same as 1.
if so, it will wait untill the choice is clicked which it will save in a variable( maybe as a number)
if not, it will wait for for player 2's choice instead of ones choice.
If you want me to make a project with this script then ask me.
Yes please because am making this fighting game and I would like both players to be able to choose their own characters then after chose the map.
tr3poz
Scratcher
1 post

HOW TO MAKE A 2 players selcetion screen?

stmbbg wrote:

adas2005 wrote:

whenclickedsetselecterto1broadcastselectandwaitsetselecterto2broadcastselect

This is sort of the first script you would use, I can't make the rest because it'll be confusing for me.
so I'll explain:
After (select) is broadcasted, it then needs to check if (selecter) is the same as 1.
if so, it will wait untill the choice is clicked which it will save in a variable( maybe as a number)
if not, it will wait for for player 2's choice instead of ones choice.
If you want me to make a project with this script then ask me.
Yes please because am making this fighting game and I would like both players to be able to choose their own characters then after chose the map.
so now what? where can i see the script?? D:
TimeLordPlanet
Scratcher
500+ posts

HOW TO MAKE A 2 players selcetion screen?

Okay, so here's the script. This script assumes that it is in the “Single Player Button” sprite, though a similar script must also be used in the “2 Player Button” sprite.
whenIreceivePlayer Screenforeveriftouchingmouse pointer?andmousedown?thenset2 Player?toFalse
This script uses what's known as a boolean variable, one that has only two options: True and False. Scratch doesn't officially support boolean variables, but you can use them by setting the string ones to “True” and “False” as I've done here. If you need a numeric variable instead, you can use 1 or 0. The “2 Player button” sprite, uses the exact same code but with the “True” value for the 2 Player? variable, like so:
whenIreceivePlayer Screenforeveriftouchingmouse pointer?andmousedown?thenset2 Player?toTrue
Then, assuming that in this game P1 uses the arrow keys and P2 uses WASD (such as in the web game Fire Boy and Ice Girl), the following script can be used in the P1 sprite, replacing the left and right arrow keys with WASD in the P2 sprite.
whenIreceiveStart Gameforeverif2Player?=Falsethenifkey left arrowpressed?thenpointindirection90move7stepsifkeyright arrowpressed?thenpointindirection-90move-7steps
Then, you can use the
or
block so that in Single Player, the player has the option to use either the arrow keys OR the WASD keys for movement:
whenIreceiveStart Gameforeverif2Player?=Falsethenifkey left arrowpressed?orkeydpressed?thenpointindirection90move7stepsifkeyright arrowpressed?orkeyapressed?thenpointindirection-90move-7steps
Obviously, this is only for horizonatal movement. For vertical movement you would have to institute gravity and probably momentum mechanics, which I will not document in this post.

Hope this helps!
TLP

Last edited by TimeLordPlanet (Aug. 29, 2018 08:32:38)

RealmKing01
Scratcher
1 post

HOW TO MAKE A 2 players selcetion screen?

That was helpful but how do i make a 2 player game anybody know a video
-_Soul_-
Scratcher
100+ posts

HOW TO MAKE A 2 players selcetion screen?

RealmKing01 wrote:

That was helpful but how do i make a 2 player game anybody know a video
Try griffpatch's video.


Oh yeah, and please don't necropost. Create a new topic instead.

Last edited by -_Soul_- (May 4, 2020 02:30:14)

sidbis123
Scratcher
22 posts

HOW TO MAKE A 2 players selcetion screen?

stmbbg wrote:

bump
Isn't that called necroposting?
Superman234567890
Scratcher
4 posts

HOW TO MAKE A 2 players selcetion screen?

stmbbg wrote:

Am making a 2 player fighting game how would I make a selecting screen were both players can chose there characters before they fight?
I want to make a two player game
Bop_Studios
Scratcher
5 posts

HOW TO MAKE A 2 players selcetion screen?

whenclickedforeverifthentouching?endend
Bop_Studios
Scratcher
5 posts

HOW TO MAKE A 2 players selcetion screen?

OR Less laggy
whenclickedforeverifkey<key [pressed?v]pressed?>thenplaysoundmovestepsturndegreeswhen<mouse down?>(answer)(answer)>10askpickrandom-0to10-0andwaitendend
Nezon
Scratcher
1000+ posts

HOW TO MAKE A 2 players selcetion screen?

Please don't neropost.

Powered by DjangoBB