How do I code a social game?

I’m trying to code a social game with tappable overlays

The idea is the reader can tap either a bubble placed above a group of characters or an arrow which will make the main character walk to the next zone (starts in zone 2, but will make character walk to zone 1 then give the option of another arrow to take them back to zone 2)

And walk to the next zone so the reader can tap the other bubbles…

After the reader has tapped a bubble I want it to disappear so they can’t tap it again until there is no more tappable bubbles left…

I’ve got a rough idea, but not a complete idea on how to do this social game…

Current script:

EXT. HOUSE POOL - DAY

@overlay POOL create

@overlay POOL opacity 0.50

@overlay POOL moves to layer -3

@overlay POOL scales to 1.000 1.000

@overlay POOL shifts to 5 -16

@overlay POOLROCK create

@overlay POOLROCK opacity 1

@overlay POOLROCK moves to layer 0

@overlay POOLROCK scales to 1.000 1.000

@overlay POOLROCK shifts to -1 1

&DELILAH spot 0.605 211 352 AND DELILAH is idle_awkward AND DELILAH faces left AND DELILAH moves to layer -7 AND DUCHESS spot 0.722 260 197 AND DUCHESS faces left AND DUCHESS moves to layer -6 AND DUCHESS is talk_sit_legs_up

@DELILAH changes into DELILAHSWIM

@DUCHESS changes into DUCHESSSWIM

&ESTELLA spot 0.713 60 80 AND ESTELLA moves to layer -5 AND ESTELLA faces right AND ESTELLA is dance_groove_loop AND KHRISTIANAMOM spot 0.677 164 97 AND KHRISTIANAMOM moves to layer -4 AND KHRISTIANAMOM faces left AND KHRISTIANAMOM is think

@ESTELLA changes into ESTELLASWIM

@KHRISTIANAMOM changes into KHRISTIANAMOMSWIM

&OCTAVIA spot 0.947 289 69 AND OCTAVIA faces right AND OCTAVIA is idle_sit_rear AND OCTAVIA moves to layer -1

@OCTAVIA changes into OCTAVIASWIM

@cut to zone 2

&KHRISTIANA spot 0.596 201 333 AND YVONNE spot 0.641 265 313 AND YVONNE faces left AND YVONNE is talk_gossip AND KHRISTIANA faces right AND KHRISTIANA is listen_gossip AND KHRISTIANA moves to layer -7 AND YVONNE moves to layer -6

@KHRISTIANA changes into KHRISTIANASWIM

@YVONNE changes into YVONNESWIM

&MARCUS spot 0.650 150 313 AND MARCUS faces right AND MARCUS moves to layer -5 AND MARCUS is think

@MARCUS changes into MARCUSSWIM

@cut to zone 1

@transition fade in black in 3

@zoom on 20 46 to 281% in 2

@zoom on 173 67 to 281% in 2

@zoom on 320 236 to 281% in 2

@zoom on 251 399 to 281% in 2

@zoom on 0 0 to 100% in 3

@pan to zone 2 in 5

@pause for a beat

if (ELITESWIMSUITS) {

@ANNABELLO changes into ELITEANNASWIM

@MAIN changes into ELITEMAINSWIM

} else {

@ANNABELLO changes into ANNASWIM

@MAIN changes into MAINSWIM

}

@ANNABELLO enters from right to spot 1.280 88 -38 in 3 AND ANNABELLO faces left AND ANNABELLO is walk_talk_happy AND ANNABELLO moves to layer 1 AND MAIN enters from right to spot 1.280 206 -35 in 4 AND MAIN faces left AND MAIN is walk_talk_happy AND MAIN moves to layer 2

@ANNABELLO faces right AND ANNABELLO is think AND MAIN is arms_crossed

    ANNABELLO (talk_gesture)
I think I will go talk with your grandpa and the girls before the challenge begins.

    MAIN (talk_greet)
Alright, Have fun.

@ANNABELLO walks to spot 0.821 150 226 in 3 AND ANNABELLO is walk_trudge AND ANNABELLO faces right

@ANNABELLO walks to spot 0.659 94 301 in 2 AND ANNABELLO faces left AND ANNABELLO is walk_trudge AND MAIN is think

@ANNABELLO faces right AND ANNABELLO is talk_greet AND YVONNE is talk_apathetic

@pause for a beat

    MAIN (talk_think)
(I think I should socialize with some of the competition before the challenge starts.)

@MAIN is shiftweight

@overlay TALKBUBBLE create

@overlay TALKBUBBLE shifts to 99 385 in zone 2

@overlay TALKBUBBLE scales to 0.514 0.514

@overlay TALKBUBBLE opacity 0

@overlay TALKBUBBLE moves to layer 2

@overlay LEFTARROW create

@overlay LEFTARROW shifts to -41 138 in zone 2

@overlay LEFTARROW scales to 0.856 0.856

@overlay LEFTARROW opacity 0

@overlay LEFTARROW moves to layer 2

@overlay LEFTARROW opacity 1 in 4 AND overlay TALKBUBBLE opacity 1 in 4

    MAIN (talk_think)
Hmm, who should I talk to?

tappable
“TALKBUBBLE” {

@overlay TALKBUBBLE opacity 0 in 3 AND overlay LEFTARROW opacity 0 in 3

@MAIN walks to spot 0.650 302 300 in 4 AND MAIN faces right AND MAIN is walk_trudge AND YVONNE walks to spot 0.614 255 321 in 2 AND YVONNE faces left

@MAIN faces left AND YVONNE is primp_condescend AND MAIN is talk_greet AND MARCUS is talk_greet

@zoom on 623 440 to 134% in 3

if (ELITESWIMSUITS) {

    YVONNE (talk_handsonhips)
Those swimsuits are so fashionable, not gonna lie.

@YVONNE +5

    KHRISTIANA (talk_suggest)
I agree, those swimmers look so tropical.

@KHRISTIANA +5

    MARCUS (talk_apathetic)
I don't know about Annabello, but I know Avery takes her fashion sense after me.

@MAIN is laugh_guffaw AND MARCUS is think AND ANNABELLO is laugh_giggle AND KHRISTIANA is laugh_chuckle AND YVONNE is laugh_giggle

    MAIN (talk_happy_smile)
Sorry grandpa, we both know I've got grandma's taste in fashion.

@MAIN is eyeroll AND MAIN is laugh_giggle

@ANNABELLO +5

} else {

}

} “LEFTARROW” {

}

Tags:

@Dara.Amarie
@JemU776
@Apes

1 Like

Do you still need help with this? I might be able to help you!

1 Like

Yes, I do still need help (Sorry for the late response, I just woke up at 7, it’s 7:46 right now.)

1 Like

-cracks knuckles- This is about as complex of coding as I’ve ever done, but hopefully I can give you a few tips.

I’ve coded a similar game, it has 3 general parts:

  • Overlay creation—overlays are created based on how far the player has gone in the game
  • Game itself—it’ll need gains to let the app know when the players have already clicked a bubble
  • “Check” sequence where the app checks if the reader is done playing, based on gains earned

Here’s my basic samples of how I coded it:

Sample of overlay creation

label start_social_game

if ( [not bubble_1_complete] ){
@overlay BUBBLE1 create AND BUBBLE1 opacity 1 in 0 AND BUBBLE1 shifts to 100 100 AND BUBBLE1 scales to 1.000 1.000
}
if ( [not bubble_2_complete] ){
@overlay BUBBLE2 create AND BUBBLE2 opacity 1 in 0 AND BUBBLE2 shifts to 200 100 AND BUBBLE2 scales to 1.000 1.000
}

Sample of what a bubble sequence will look like

tappable
“BUBBLE1”{

@overlay BUBBLE1 opacity 0 in 3
@overlay BUBBLE1 clear

PEOPLE
Dialogue and scene here.

gain bubble_1_complete
} “BUBBLE2”{

@overlay BUBBLE2 opacity 0 in 3
@overlay BUBBLE2 clear

PEOPLE
Dialogue and scene here.

gain bubble_2_complete
}

Sample "check" sequence that would go below your game coding

if (bubble_1_complete){
if (bubble_2_complete){
if (bubble_3_complete){
goto continue_story
}}}

goto start_social_game

Putting it all together

EXT. HOUSE POOL - DAY
###Here you set the scene; place characters, place the pool overlays, anything not related to the game. In your script, that looks like everything before “@MAIN is shiftweight”

label start_social_game

if ( [not bubble_1_complete] ){
@overlay BUBBLE1 create AND BUBBLE1 opacity 1 in 0 AND BUBBLE1 shifts to 100 100 AND BUBBLE1 scales to 1.000 1.000
}
if ( [not bubble_2_complete] ){
@overlay BUBBLE2 create AND BUBBLE2 opacity 1 in 0 AND BUBBLE2 shifts to 200 100 AND BUBBLE2 scales to 1.000 1.000
}

tappable
“BUBBLE1”{

@overlay BUBBLE1 opacity 0 in 3
@overlay BUBBLE1 clear

PEOPLE
Dialogue and scene here.

gain bubble_1_complete
} “BUBBLE2”{

@overlay BUBBLE2 opacity 0 in 3
@overlay BUBBLE2 clear

PEOPLE
Dialogue and scene here.

gain bubble_2_complete
}

if (bubble_1_complete){
if (bubble_2_complete){
if (bubble_3_complete){
goto continue_story
}}}

goto start_social_game

Now, that’s only part of it; my game happened in 1 zone. Having 2 zones throws another wrench into it. :slight_smile:

I think the best way to do this is to have 1 tappable game that spans both zones. :thinking:

Putting it all together... with the game happening in 2 zones

EXT. HOUSE POOL - DAY
###Here you set the scene; place characters, place the pool overlays, anything not related to the game. In your script, that looks like everything before “@MAIN is shiftweight”. However, the arrows should be created here, outside of the main gameplay.

@overlay RIGHTARROW create AND RIGHTARROW shifts to 100 200 in zone 1 AND RIGHTARROW opacity 1 in 3 AND RIGHTARROW scales to 1.0 1.0

@overlay LEFTARROW create AND LEFTARROW shifts to 100 300 in zone 2 AND LEFTARROW opacity 1 in 3 AND LEFTARROW scales to 1.0 1.0

label start_social_game

if ( [not bubble_1_complete] ){
@overlay BUBBLE1 create AND BUBBLE1 opacity 1 in 0 AND BUBBLE1 shifts to 100 100 in zone 2 AND BUBBLE1 scales to 1.000 1.000
}
if ( [not bubble_2_complete] ){
@overlay BUBBLE2 create AND BUBBLE2 opacity 1 in 0 AND BUBBLE2 shifts to 200 100 in zone 2 AND BUBBLE2 scales to 1.000 1.000
}
if ( [not bubble_3_complete] ){
@overlay BUBBLE3 create AND BUBBLE3 opacity 1 in 0 AND BUBBLE3 shifts to 200 100 in zone 1 AND BUBBLE3 scales to 1.000 1.000
}

###Bubble 3 is in zone 1, the others are in zone 2.

tappable
“BUBBLE1”{

@overlay BUBBLE1 opacity 0 in 3
@overlay BUBBLE1 clear

PEOPLE
Dialogue and scene here.

gain bubble_1_complete
} “BUBBLE2”{

@overlay BUBBLE2 opacity 0 in 3
@overlay BUBBLE2 clear

PEOPLE
Dialogue and scene here.

gain bubble_2_complete
} “BUBBLE3” {

@overlay BUBBLE3 opacity 0 in 3
@overlay BUBBLE3 clear

PEOPLE
Dialogue and scene here.

gain bubble_3_complete
} “LEFTARROW” {

@MAIN walks to screen center in zone 1

} “RIGHTARROW” {

@MAIN walks to screen center in zone 2

}

if (bubble_1_complete){
if (bubble_2_complete){
if (bubble_3_complete){
goto continue_story
}}}

goto start_social_game

label continue_story

MAIN
Well, I’ve spoken to everyone, let’s go.

So, this is pretty choppy, and I’ve never actually done this over 2 zones before, but that’ll hopefully give you some ideas. :sweat_smile: You can spice this up as needed (decrease the opacity of the arrows during the scene and increase the opacity just before the scene ends) etc.

2 Likes

Okay, so would this be right?

Script:

label SOCIALGAMESTART

if (SOCIALONECOMPLETE) {

@overlay TALKBUBBLE shifts to 388 348 in zone 2 in 0 AND overlay TALKBUBBLE opacity 0

} else {

}
MAIN (talk_think)
Hmm, who should I talk to?

tappable
“TALKBUBBLE” {

gain SOCIALONECOMPLETE

@overlay TALKBUBBLE opacity 0 in 3 AND overlay LEFTARROW opacity 0 in 3

@MAIN walks to spot 0.650 302 300 in 4 AND MAIN faces left AND MAIN is walk_trudge AND YVONNE walks to spot 0.614 255 321 in 2 AND YVONNE faces left

@MAIN faces left AND YVONNE is primp_condescend AND MAIN is talk_greet AND MARCUS is talk_greet

@zoom on 623 440 to 134% in 3

    MAIN (talk_suggest)
Hey guys, do you mind if I join you?

    KHRISTIANA (talk_gesture)
Of course we don't mind,

    KHRISTIANA (talk_handsonhips)
The more the merrier.

    MAIN (talk_happy_smile)
Thanks!

    MAIN (talk_shrug)
So what are you guys doing after the challenge?

    KHRISTIANA (talk_think)
Well, we've got the house vote after the challenge is over but,

    KHRISTIANA (talk_arms_crossed)
I'll most likely write some songs and do my vocal warm-ups.

@YVONNE is eyeroll_subtle

@zoom on 398 373 to 532% in 0

    ANNABELLO (talk_forward)
Yvonne and I are going to go to the work-out room later,

    ANNABELLO (talk_exhausted)
And after that I will be looking at what's in the kitchen,

    ANNABELLO (talk_handsonhips)
I need to make sure the shows crew stocked up for a | bold | vegetarian | reset | like myself.

@zoom on 623 440 to 134% in 0

    MARCUS (talk_think)
I still have to unpack, I didn't want to unpack if there was a chance of me leaving in an hour or two.

    MAIN (talk_repulsed)
What?

    MAIN (talk_arms_crossed_angry)
If you doubt yourself then of course you will end up leaving,

    MAIN (talk_suggest)
Have more confidence in yourself!

    MARCUS (talk_shrug)
Alright aviator.

if (ELITESWIMSUITS) {

    YVONNE (talk_handsonhips)
Those swimsuits are so fashionable, not gonna lie.

@YVONNE +5

    KHRISTIANA (talk_suggest)
I agree, those swimmers look so tropical.

@KHRISTIANA +5

    MARCUS (talk_apathetic)
I don't know about Annabello, but I know Avery takes her fashion sense after me.

@MAIN is laugh_guffaw AND MARCUS is think AND ANNABELLO is laugh_giggle AND KHRISTIANA is laugh_chuckle AND YVONNE is laugh_giggle

    MAIN (talk_happy_smile)
Sorry grandpa, we both know I've got grandma's taste in fashion.

@MARCUS is eyeroll AND MAIN is laugh_giggle

@ANNABELLO +5

} else {

    YVONNE (talk_airquotes)
Those swimsuits are a very 'bold' choice.

    YVONNE (talk_repulsed)
(I kind of wish that I could unsee my grandmother in a bikini.)

@YVONNE is deepbreath AND ANNABELLO is idle_awkward

    MAIN (talk_exhausted)
(We should have went with the other swimsuits!)

if (KHRISTIANA>9) {

readerMessage | bold, color:red | Khristiana | reset |stood up for you! with messageTitle Alliance Alert:

    KHRISTIANA (talk_arms_crossed)
I think they look great, regardless of what they wear.

    KHRISTIANA (talk_shrug)
Besides, some people didn't even put a swimsuit on.

@YVONNE is eyeroll

@KHRISTIANA +3

    NARRATOR
Great work! Your relationship with | bold, color:red | Khristiana | reset | is high enough that she defended you!

} else {

@KHRISTIANA is eyeroll_subtle

    NARRATOR
Ouch! Your relationship with | bold, color:red | Khristiana | reset | isn't high enough for her to defend you!

@ANNABELLO is idle_sad

@ANNABELLO -3

}

}

@MAIN is dustoff_loop

    MAIN (talk_greet)
I'm going to go and talk with some of the others, best of luck everyone!

@ANNABELLO is talk_greet AND MARCUS is talk_greet

@zoom on 0 0 to 100% in 2

@MAIN walks to spot 1.280 206 -35 in 4 AND MAIN faces left AND MAIN is walk_trudge

@overlay LEFTARROW opacity 1 in 3 AND overlay TALKBUBBLE shifts to 388 348 in zone 2 in 0 AND MAIN is think

goto SOCIALGAMESTART

} “LEFTARROW” {

@pan to zone 1 in 5 AND overlay TALKBUBBLE2 opacity 1 in 5 AND overlay TALKBUBBLE3 opacity 1 in 5 AND MAIN walks to spot 1.280 164 -46 in zone 1 in 5 AND overlay RIGHTARROW opacity 1 in 5 AND overlay LEFARROW opacity 0 in 5

}

label ZONEONESOCIALGAMESTART

if (SOCIALTWOCOMPLETE) {

@overlay TALKBUBBLE2 shifts to 388 348 in zone 2 in 0 AND overlay TALKBUBBLE2 opacity 0 AND MAIN moves to layer 2 AND MAIN spot 1.280 164 -46 in zone 1 AND MAIN faces left AND MAIN is think

@zoom reset

} elif (SOCIALTHREECOMPLETE) {

@overlay TALKBUBBLE3 shifts to 388 348 in zone 2 in 0 AND overlay TALKBUBBLE opacity 0

} else {

}

tappable
“TALKBUBBLE2” {

@transition fade out black in 3

@overlay TALKBUBBLE2 opacity 0 in 0 AND overlay TALKBUBBLE3 opacity 0 in 0 AND overlay RIGHTARROW opacity 0 in 0

@zoom on 55 67 to 213% in 0

@MAIN spot 0.758 111 58 AND MAIN faces left AND MAIN is hop_fast AND MAIN moves to layer -5

@transition fade in black

@pause for a beat

@pause for 0.7

    MAIN (talk_greet)
Hey girls, Can I join you for a swim?

    KHRISTIANAMOM (flirt_fingersnap)
I dunno, can you?

@MAIN is laugh_giggle AND ESTELLA is laugh_chuckle AND KHRISTIANAMOM is laugh_guffaw

#CONTINUE SCRIPT HERE#

gain SOCIALTWOCOMPLETE

goto ZONEONESOCIALGAMESTART

} “TALKBUBBLE3” {

#CONTINUE SCRIPT HERE#

gain SOCIALTHREECOMPLETE

goto ZONEONESOCIALGAMESTART

} “RIGHTARROW” {

@pan to zone 2 in 5 AND overlay TALKBUBBLE2 opacity 0 in 5 AND overlay TALKBUBBLE3 opacity 0 in 5 AND MAIN walks to spot 1.280 206 -35 in zone 2 in 5 AND MAIN faces right AND overlay RIGHTARROW opacity 0 in 5 AND MAIN is walk_trudge AND overlay LEFTARROW opacity 1 in 5

@MAIN is think AND MAIN faces left

goto SOCIALGAMESTART

}

Lol completely different from my rough draft, but definitely on the right track, and your method looks more direct and less convoluted lol. :+1:

Only a few things:

Regarding the zone 1 side

if (SOCIALTWOCOMPLETE) {

@overlay TALKBUBBLE2 shifts to 388 348 in zone 2 in 0 AND overlay TALKBUBBLE2 opacity 0 AND MAIN moves to layer 2 AND MAIN spot 1.280 164 -46 in zone 1 AND MAIN faces left AND MAIN is think

@zoom reset

} elif (SOCIALTHREECOMPLETE) {

@overlay TALKBUBBLE3 shifts to 388 348 in zone 2 in 0 AND overlay TALKBUBBLE opacity 0

} else {

}

If there’s an if, then an elif, the computer will only pick the first one it sees. It’s best to have two independent "if"s, bubble3 being completed doesn’t depend on bubble2 being completed, the readers can do it in any order.

My edit to the zone 1 side

if (SOCIALTWOCOMPLETE) {

@overlay TALKBUBBLE2 shifts to 388 348 in zone 2 in 0 AND overlay TALKBUBBLE2 opacity 0 AND MAIN moves to layer 2 AND MAIN spot 1.280 164 -46 in zone 1 AND MAIN faces left AND MAIN is think

@zoom reset

} else {

}

if (SOCIALTHREECOMPLETE) {

@overlay TALKBUBBLE3 shifts to 388 348 in zone 2 in 0 AND overlay TALKBUBBLE opacity 0

} else {

}

That should allow the reader to play the game, however, there still needs to be some “check” sequence that’ll let the reader out once all 3 gains have been gained.

With the setup that you have now, you can put a “check” at the end of each bubble’s section, that checks if the other two are finished.

Here's what it would look like at the end of bubble3

} “TALKBUBBLE3” {

#CONTINUE SCRIPT HERE#

gain SOCIALTHREECOMPLETE

if (SOCIALONECOMPLETE){
if (SOCIALTWOCOMPLETE){
goto CONTINUE_STORY
}else{
goto ZONEONESOCIALGAMESTART
}
}else{
goto ZONEONESOCIALGAMESTART
}

}

1 Like

What would I do for TALKBUBBLE?

Inside TALKBUBBLE, you check for the remaining two (in case the reader goes left first and leaves TALKBUBBLE for last)

Like this

tappable
“TALKBUBBLE” {

gain SOCIALONECOMPLETE

###Scene here

if (SOCIALTWOCOMPLETE){
if (SOCIALTHREECOMPLETE){
goto CONTINUE_STORY
}else{
goto SOCIALGAMESTART
}
}else{
goto SOCIALGAMESTART
}

} “LEFTARROW” {

@pan to zone 1 in 5 AND overlay TALKBUBBLE2 opacity 1 in 5 AND overlay TALKBUBBLE3 opacity 1 in 5 AND MAIN walks to spot 1.280 164 -46 in zone 1 in 5 AND overlay RIGHTARROW opacity 1 in 5 AND overlay LEFARROW opacity 0 in 5

}

:+1: