custom textboxes
Word count: 5,820 words
This commit is contained in:
		
							parent
							
								
									ba2d198ba3
								
							
						
					
					
						commit
						0c409e040b
					
				
					 8 changed files with 164 additions and 23 deletions
				
			
		
							
								
								
									
										
											BIN
										
									
								
								game/audio/bowling.mp3
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								game/audio/bowling.mp3
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 1.7 KiB  | 
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 1.6 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								game/gui/button/choicebox.png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								game/gui/button/choicebox.png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 1.4 KiB  | 
| 
						 | 
				
			
			@ -9,13 +9,13 @@
 | 
			
		|||
##
 | 
			
		||||
## Put the splash screen code here. It runs when the game is launched.
 | 
			
		||||
##
 | 
			
		||||
label splashscreen():
 | 
			
		||||
    return
 | 
			
		||||
# label splashscreen():
 | 
			
		||||
#     return
 | 
			
		||||
 | 
			
		||||
## After Load ##################################################################
 | 
			
		||||
##
 | 
			
		||||
## Adjust any variables etc in the after_load label
 | 
			
		||||
## Also consider: define config.after_load_callbacks = [ ... ]
 | 
			
		||||
##
 | 
			
		||||
label after_load():
 | 
			
		||||
    return
 | 
			
		||||
# label after_load():
 | 
			
		||||
#     return
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -10,23 +10,24 @@
 | 
			
		|||
screen choice(items):
 | 
			
		||||
    style_prefix "choice"
 | 
			
		||||
 | 
			
		||||
    vbox:
 | 
			
		||||
    grid 2 6:
 | 
			
		||||
        for i in items:
 | 
			
		||||
            textbutton i.caption action i.action
 | 
			
		||||
            textbutton i.caption action i.action:
 | 
			
		||||
                xalign 0.5
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
style choice_vbox:
 | 
			
		||||
style choice_grid:
 | 
			
		||||
    xalign 0.5
 | 
			
		||||
    ypos 405
 | 
			
		||||
    yanchor 0.5
 | 
			
		||||
    yanchor 0.0
 | 
			
		||||
    spacing 33
 | 
			
		||||
 | 
			
		||||
style choice_button:
 | 
			
		||||
    is default # This means it doesn't use the usual button styling
 | 
			
		||||
    xysize (926, None)
 | 
			
		||||
    xysize (None, 144)
 | 
			
		||||
    background Frame("gui/button/choice_[prefix_]background.png",
 | 
			
		||||
        150, 25, 150, 25, tile=False)
 | 
			
		||||
    padding (12, 12)
 | 
			
		||||
    padding (100, 12)
 | 
			
		||||
 | 
			
		||||
style choice_button_text:
 | 
			
		||||
    is default # This means it doesn't use the usual button text styling
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										166
									
								
								game/script.rpy
									
										
									
									
									
								
							
							
						
						
									
										166
									
								
								game/script.rpy
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
# What is left?
 | 
			
		||||
#                 TEXT    STAGE    VAR
 | 
			
		||||
# introduction      Y       N       Y
 | 
			
		||||
# introduction      Y       Y       Y
 | 
			
		||||
# icebreakers       Y       N       Y
 | 
			
		||||
# hands-on lecture  Y       N       Y
 | 
			
		||||
# consultation      Y       N       Y
 | 
			
		||||
| 
						 | 
				
			
			@ -10,6 +10,7 @@
 | 
			
		|||
 | 
			
		||||
default persistent.pixelfont = True
 | 
			
		||||
default persistent.laozi = False
 | 
			
		||||
default persistent.playeranswer = "" # just a random string, not just empty otherwise people could submit empty ones but not have that saved for next time
 | 
			
		||||
 | 
			
		||||
define yuuka = Character("Yuuka", callback = name_callback, cb_name = "yuuka")
 | 
			
		||||
define reimu = Character("Reimu", callback = name_callback, cb_name = "reimu")
 | 
			
		||||
| 
						 | 
				
			
			@ -19,6 +20,44 @@ define yumemi = Character("Yumemi", callback = name_callback, cb_name = "yumemi"
 | 
			
		|||
define janitor = Character("Totally Normal Janitor", callback = name_callback, cb_name = "yumemi")
 | 
			
		||||
define narrator = Character(callback = name_callback, cb_name = None)
 | 
			
		||||
 | 
			
		||||
define longfade = Fade(0, 0.5, 3)
 | 
			
		||||
# Camera flash - quickly fades to white, then back to the scene.
 | 
			
		||||
define flash = Fade(0.1, 0.0, 0.5, color="#fff")
 | 
			
		||||
define longflash = Fade(0.1, 1, 1, color="#fff")
 | 
			
		||||
 | 
			
		||||
init python:
 | 
			
		||||
    def truncate(n, decimals=0):
 | 
			
		||||
        multiplier = 10 ** decimals
 | 
			
		||||
        return int(n * multiplier) / multiplier
 | 
			
		||||
 | 
			
		||||
label splashscreen:
 | 
			
		||||
    scene movie1
 | 
			
		||||
    scene black
 | 
			
		||||
 | 
			
		||||
    python:
 | 
			
		||||
        import time
 | 
			
		||||
 | 
			
		||||
        if persistent.secretKey is None:
 | 
			
		||||
            persistent.secretKey = truncate(time.time() * 666, 12)
 | 
			
		||||
 | 
			
		||||
            renpy.save_persistent()
 | 
			
		||||
 | 
			
		||||
    show text "Hit Shift-A to replace the font and change text scaling."
 | 
			
		||||
    with Pause(7)
 | 
			
		||||
 | 
			
		||||
    hide text with fade
 | 
			
		||||
    $ renpy.pause(1.0)
 | 
			
		||||
 | 
			
		||||
    show text "This is a fan-made video game not affiliated\nwith or endorsed by the original creators.\n\n{color=e63d3c}Touhou Project{/color} original concept, characters, and elements are property of {color=e63d3c}ZUN{/color} and {color=e63d3c}Team Shanghai Alice{/color}. Please support the official series."
 | 
			
		||||
    with Pause(7)
 | 
			
		||||
 | 
			
		||||
    hide text with fade
 | 
			
		||||
    $ renpy.pause(1.0)
 | 
			
		||||
 | 
			
		||||
    nvl clear
 | 
			
		||||
 | 
			
		||||
    return
 | 
			
		||||
 | 
			
		||||
transform damaged:
 | 
			
		||||
    yalign 0.5
 | 
			
		||||
    xalign 0.5
 | 
			
		||||
| 
						 | 
				
			
			@ -469,6 +508,7 @@ label start:
 | 
			
		|||
                jump presentation_begins
 | 
			
		||||
 | 
			
		||||
        $ persistent.laozi = True
 | 
			
		||||
        $ renpy.save_persistent()
 | 
			
		||||
        # show text "      {font=m3x6.ttf}For this reason the great man dwells in the thick, and does not rest with the thin.{/font}\n{font=m6x11.ttf}He dwells in the {color=#cc2222}fruit{/color}, and does not rest with the {color=#ffff00}flower{/font}{/color}.\n                                                                 {font=m3x6.ttf}- Laozi, Tao Te Ching{/font}" at truecenter
 | 
			
		||||
        show text "{alpha=0.2}For this reason the great man dwells in the thick, and does not rest with the thin.{/alpha}\nHe dwells in the {color=#cc2222}fruit{/color}, and does not rest with the {color=#ffff00}flower{/color}.\n                {alpha=0.6}- Laozi, Tao Te Ching{/alpha}" at truecenter
 | 
			
		||||
        with dissolve
 | 
			
		||||
| 
						 | 
				
			
			@ -769,6 +809,8 @@ label start:
 | 
			
		|||
 | 
			
		||||
                        "No, obviously.":
 | 
			
		||||
 | 
			
		||||
                            stop music
 | 
			
		||||
 | 
			
		||||
                            show yuuka neutral:
 | 
			
		||||
                                xalign 0.0
 | 
			
		||||
                                yalign 0.5
 | 
			
		||||
| 
						 | 
				
			
			@ -789,20 +831,18 @@ label start:
 | 
			
		|||
 | 
			
		||||
                            $ renpy.pause(0.85, hard=True)
 | 
			
		||||
 | 
			
		||||
                            show marisa surprise at spin, thrown_offscreen:
 | 
			
		||||
                            play sound "bowling.mp3"
 | 
			
		||||
 | 
			
		||||
                            show marisa surprise at damaged, spin, thrown_offscreen:
 | 
			
		||||
                                xalign 1.0
 | 
			
		||||
                                yalign 0.5
 | 
			
		||||
                            
 | 
			
		||||
                            yuuka "{i}Then I hit her really hard.{/i}" (cb_name="")
 | 
			
		||||
 | 
			
		||||
                            # TODO: marisa spinning studio trigger style
 | 
			
		||||
 | 
			
		||||
                            marisa ":O"
 | 
			
		||||
 | 
			
		||||
                            yuuka "From the earth you came, to the dirt you'll bite."
 | 
			
		||||
 | 
			
		||||
                            # TODO: kamehameha
 | 
			
		||||
 | 
			
		||||
                            show bg black with fade
 | 
			
		||||
 | 
			
		||||
                            yuuka "{i}Then she was gone, just like that.{nw=2.5}{/i}" (cb_name="")
 | 
			
		||||
| 
						 | 
				
			
			@ -872,6 +912,9 @@ label start:
 | 
			
		|||
                            jump ending
 | 
			
		||||
 | 
			
		||||
                        "...yes. Marisa can be trusted.":
 | 
			
		||||
 | 
			
		||||
                            stop music fadeout 2.0
 | 
			
		||||
 | 
			
		||||
                            yuuka "..."
 | 
			
		||||
 | 
			
		||||
                            marisa "..."
 | 
			
		||||
| 
						 | 
				
			
			@ -917,18 +960,34 @@ label start:
 | 
			
		|||
                    jump icebreakers
 | 
			
		||||
 | 
			
		||||
            label icebreakers:
 | 
			
		||||
 | 
			
		||||
                show yuuka amused:
 | 
			
		||||
                    xalign 0.0
 | 
			
		||||
                    yalign 0.5
 | 
			
		||||
                with easeinleft
 | 
			
		||||
                
 | 
			
		||||
                yuuka "Yes, that would be very helpful."
 | 
			
		||||
 | 
			
		||||
                narrator "{i}Led by the student, Yuuka entered the building.{/i}"
 | 
			
		||||
 | 
			
		||||
                scene bg hallway with fade
 | 
			
		||||
 | 
			
		||||
                show yuuka amused:
 | 
			
		||||
                    xalign 0.0
 | 
			
		||||
                    yalign 0.5
 | 
			
		||||
                with easeinleft
 | 
			
		||||
 | 
			
		||||
                yuuka "It's very..."
 | 
			
		||||
 | 
			
		||||
                "Student" "Modern, isn't it?"
 | 
			
		||||
 | 
			
		||||
                scene bg classroom with fade
 | 
			
		||||
 | 
			
		||||
                show yuuka amused:
 | 
			
		||||
                    xalign -0.2
 | 
			
		||||
                    yalign 0.5
 | 
			
		||||
                with easeinleft
 | 
			
		||||
 | 
			
		||||
                narrator "{i}The student, leading Yuuka to her class, held the door open for her, letting her get a peek inside.{/i}"
 | 
			
		||||
 | 
			
		||||
                if not attacked_student:
 | 
			
		||||
| 
						 | 
				
			
			@ -947,6 +1006,15 @@ label start:
 | 
			
		|||
                if not attacked_student:
 | 
			
		||||
                    yuuka "{sc}Amusing{/sc} as a misunderstanding this is, I really should be..."
 | 
			
		||||
 | 
			
		||||
                show yuuka irritated:
 | 
			
		||||
                    xalign -0.2
 | 
			
		||||
                    yalign 0.5
 | 
			
		||||
 | 
			
		||||
                show marisa happy:
 | 
			
		||||
                    xalign 0.8
 | 
			
		||||
                    yalign 0.5
 | 
			
		||||
                with easeinright
 | 
			
		||||
 | 
			
		||||
                marisa "Hey teach, how about we get a move on before lunch's on!"
 | 
			
		||||
 | 
			
		||||
                if attacked_student:
 | 
			
		||||
| 
						 | 
				
			
			@ -954,12 +1022,27 @@ label start:
 | 
			
		|||
                else:
 | 
			
		||||
                    yuuka "{i}It was at this moment that I took the time actually pick out individual faces from the crowd.{/i}" (cb_name="")
 | 
			
		||||
 | 
			
		||||
                show yuuka neutral:
 | 
			
		||||
                    xalign 0.0
 | 
			
		||||
                    yalign 0.5
 | 
			
		||||
                with ease
 | 
			
		||||
 | 
			
		||||
                if attacked_student:
 | 
			
		||||
                    yuuka "{i}There was Marisa Kirisame, cooled down from our earlier encounter.{/i}" (cb_name="")
 | 
			
		||||
                else:
 | 
			
		||||
                    yuuka "{i}There was Marisa Kirisame, irritance, thief, and perpetual child as per usual.{/i}" (cb_name="")
 | 
			
		||||
 | 
			
		||||
                yuuka "{i}Sitting next to her was Alice Margatroid, hatchling spawn of Makai, and the relatively coolheaded one of the three.{/i}" (cb_name="")
 | 
			
		||||
                show alice neutral:
 | 
			
		||||
                    xalign 1.0
 | 
			
		||||
                    yalign 0.5
 | 
			
		||||
                with easeinright
 | 
			
		||||
 | 
			
		||||
                yuuka "{i}Sitting next to her was Alice Margatroid, hatchling spawn from Makai, and the relatively reasonable one of the three.{/i}" (cb_name="")
 | 
			
		||||
 | 
			
		||||
                show reimu angry:
 | 
			
		||||
                    xalign 1.2
 | 
			
		||||
                    yalign 0.5
 | 
			
		||||
                with easeinright
 | 
			
		||||
 | 
			
		||||
                yuuka "{i}Last was Reimu Hakurei, sitting in the back, with a glint in her eye staring back at me.{/i}" (cb_name="")
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -970,6 +1053,10 @@ label start:
 | 
			
		|||
 | 
			
		||||
                yuuka "{i}While I was and forever will be confident in my ability to subdue our militant shrine maiden,{/i}" (cb_name="")
 | 
			
		||||
 | 
			
		||||
                show yuuka happy:
 | 
			
		||||
                    xalign 0.0
 | 
			
		||||
                    yalign 0.5
 | 
			
		||||
 | 
			
		||||
                yuuka "{i}I am a person who can play along. It makes encounters more interesting. I put on my most polite smile and...{/i}" (cb_name="")
 | 
			
		||||
 | 
			
		||||
                if not attacked_student:
 | 
			
		||||
| 
						 | 
				
			
			@ -1187,10 +1274,12 @@ label start:
 | 
			
		|||
 | 
			
		||||
                yuuka "The only question is if I'm actually going along with this or... if I should at least get some fun out of this?"
 | 
			
		||||
 | 
			
		||||
                menu:
 | 
			
		||||
                    "What will Yuuka do?"
 | 
			
		||||
                yuuka "And after all, I should get something in return for what I give them."
 | 
			
		||||
 | 
			
		||||
                    "Be an actual teacher":
 | 
			
		||||
                menu:
 | 
			
		||||
                    "What does Yuuka give them?"
 | 
			
		||||
 | 
			
		||||
                    "Sunflowers {i}(matter-of-fact){/i}":
 | 
			
		||||
                        yuuka "Oh fine then. Alice is so insistent on me interacting with humans? Sure, no problems here."
 | 
			
		||||
 | 
			
		||||
                        yuuka "But what am I even teaching?"
 | 
			
		||||
| 
						 | 
				
			
			@ -1199,7 +1288,7 @@ label start:
 | 
			
		|||
 | 
			
		||||
                        jump lecture
 | 
			
		||||
 | 
			
		||||
                    "Give them an {size=50}✨{/size}unforgettable{size=50}✨{/size} experience":
 | 
			
		||||
                    "Sunflowers {i}(scheming){/}":
 | 
			
		||||
                        yuuka "Oh fine then. Alice is so insistent on me interacting with weaklings? Sure, no problems here."
 | 
			
		||||
 | 
			
		||||
                        yuuka "Especially, if I get a chance to shut them up."
 | 
			
		||||
| 
						 | 
				
			
			@ -2129,6 +2218,13 @@ label faculty:
 | 
			
		|||
        "Day is currently set to [day]. This should be impossible. You've likely encountered a bug."
 | 
			
		||||
        return
 | 
			
		||||
 | 
			
		||||
screen mangainput:
 | 
			
		||||
    viewport:
 | 
			
		||||
        xalign 0.5
 | 
			
		||||
        yalign 0.5
 | 
			
		||||
        xysize (400,300)
 | 
			
		||||
        input length 100 pos (0,0) color "#081820" xmaximum 400 ymaximum 300
 | 
			
		||||
 | 
			
		||||
label exam:
 | 
			
		||||
    if day == 3:
 | 
			
		||||
        # TODO
 | 
			
		||||
| 
						 | 
				
			
			@ -2143,7 +2239,51 @@ label exam:
 | 
			
		|||
 | 
			
		||||
        label garden_of_the_sun_intro:
 | 
			
		||||
            scene bg garden with fade
 | 
			
		||||
            yuuka "lets make this exam"
 | 
			
		||||
 | 
			
		||||
            $ renpy.pause(2.0)
 | 
			
		||||
 | 
			
		||||
            yuuka "I'm sorry I haven't attended to you as much this past week."
 | 
			
		||||
 | 
			
		||||
            $ renpy.pause(1.0)
 | 
			
		||||
 | 
			
		||||
            yuuka "There's just one more thing I have to do. I hope you'll understand."
 | 
			
		||||
 | 
			
		||||
            $ renpy.pause(1.0)
 | 
			
		||||
 | 
			
		||||
            yuuka "...I really do hope you'll understand."
 | 
			
		||||
 | 
			
		||||
            # exam minigame thingy not really but based on the koakuma kiss comic making
 | 
			
		||||
            # keep it simple, draw a form
 | 
			
		||||
 | 
			
		||||
            # ----------------------------------- #
 | 
			
		||||
            # Student's perspective
 | 
			
		||||
 | 
			
		||||
            "Student" "Hey, Reimu!"
 | 
			
		||||
 | 
			
		||||
            reimu "Huh, uh, yeah?"
 | 
			
		||||
 | 
			
		||||
            "Student" "Did you review Professor Okazaki's research into the soul? I'm still confused by it, I was hoping you understood it better than I did."
 | 
			
		||||
 | 
			
		||||
            reimu "Oh, you could explain what you know then, to make sure we're on the same page."
 | 
			
		||||
 | 
			
		||||
            "Student" "Sure!"
 | 
			
		||||
 | 
			
		||||
            "Student" "So the force of a magical attack is its mass measured in the weight of a soul times acceleration."
 | 
			
		||||
 | 
			
		||||
            "Student" "That means we can derive the weight of a soul if we divide the force of a magical attack by its acceleration."
 | 
			
		||||
 | 
			
		||||
            "Student" "Now, we need a way to measure the force of a-"
 | 
			
		||||
 | 
			
		||||
            yuuka "Take your seats and put away anything other than a pen."
 | 
			
		||||
 | 
			
		||||
            # F = m × a or m = F/a
 | 
			
		||||
 | 
			
		||||
            $ msg = renpy.input("Answer?", screen=u'exam_input')
 | 
			
		||||
 | 
			
		||||
            $ persistent.playeranswer = msg
 | 
			
		||||
            $ renpy.save_persistent()
 | 
			
		||||
 | 
			
		||||
            $ examQuestionResponse(msg)
 | 
			
		||||
    elif day == 4:
 | 
			
		||||
        # TODO
 | 
			
		||||
        # TEXT  N
 | 
			
		||||
| 
						 | 
				
			
			@ -2226,4 +2366,4 @@ label pause_loop:
 | 
			
		|||
    window hide
 | 
			
		||||
    $ renpy.pause()
 | 
			
		||||
 | 
			
		||||
    jump pause_loopRR
 | 
			
		||||
    jump pause_loop
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue