Skip to content

Instantly share code, notes, and snippets.

@PrinnyBaal
Created April 17, 2018 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PrinnyBaal/af7db97409d39a25dc7a087c83894c81 to your computer and use it in GitHub Desktop.
Save PrinnyBaal/af7db97409d39a25dc7a087c83894c81 to your computer and use it in GitHub Desktop.
BanterMinigame Functions
init -2 python:
#takes a gameobject, one of our targets, as a parameter/argument and does stuff to it
def growth(incoming):
#Sets a randomized spawntime for our target if it's currently off the screen
if incoming.spawnTime==0 and incoming.parry==empty:
incoming.tick=renpy.get_game_runtime()
incoming.spawnTime=renpy.random.randint(1,4)
#if target was given a spawntime this checks if its spawntime is up then gives it a 'path' variable at random
#after resetting its variables so that our screen will make them active again
elif incoming.parry==empty:
if (renpy.get_game_runtime()-incoming.tick)>=incoming.spawnTime:
incoming.clear=False
incoming.target=incoming.Otarget
incoming.blocked=incoming.Oblocked
incoming.parry=incoming.Oparry
incoming.spawnTime=0
incoming.path = renpy.random.randint(0,2)
#using the path variable the target is given a random location but never given a location over
#the dialogue box
if incoming.path == 0:
incoming.X=(renpy.random.randint(0,30) *.01)
incoming.Y=(renpy.random.randint(35,65) *.01)
incoming.zoomed=1.0
elif incoming.path == 1:
incoming.X=(renpy.random.randint(35,65) *.01)
incoming.Y=(renpy.random.randint(0,30) *.01)
incoming.zoomed=1.0
elif incoming.path == 2:
incoming.X=(renpy.random.randint(70,100) *.01)
incoming.Y=(renpy.random.randint(35,65) *.01)
incoming.zoomed=1.0
#if the target IS on the screen this code will slowly increase its size
else:
if incoming.tick==0:
incoming.tick=renpy.get_game_runtime()
elif renpy.get_game_runtime()-incoming.tick >=.1: #change this number to effect how often the size is increase. in this case it's ever tenth of a second
incoming.zoomed+=.02 #change this number to change by how much the size is increased every time
incoming.tick=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment