156 lines
No EOL
5.2 KiB
Python
156 lines
No EOL
5.2 KiB
Python
import random
|
|
# SCREEN/WINDOW VARIABLES
|
|
screen_width = 1000 #the width of the window
|
|
screen_height = 600 #the height of the window
|
|
screen_fps = 60 #self explanatory
|
|
ticks = 0 #oh dont change this, it counts the ticks and when they reach the fps it counts as one second
|
|
|
|
# PLAYER VARIABLES
|
|
active_acceleration = 7.5 #decides how fast the player moves
|
|
player_height, player_width = 50, 50 #size of the original player sprite (not used, only in prototype) DELETE LATER
|
|
playerX, playerY = 50, screen_height*0.5 #position of the player
|
|
enemyreadytoattack = False
|
|
enemychoosing = False
|
|
walkingright = False
|
|
lastplayerX = 50
|
|
lastenemyX = 850
|
|
whoseturn = 1 #1=player, 0=enemy
|
|
enemyX, enemyY = 850, screen_height*0.5 #position of the enemy
|
|
devmode = False
|
|
fightingright = False
|
|
enemyattack = random.randint(1,4)
|
|
playername = "" #self explanatory lmao
|
|
skincolor = 1 #just the skin color of the player
|
|
# 1=european
|
|
# 2=asian
|
|
# 3=black
|
|
hairstyle = 1 #self explanatory isnt it
|
|
#1 bald
|
|
#2 buzz
|
|
#3 afro
|
|
#4 mohawk
|
|
#5 grandpa
|
|
haircolor = 1 #also self explanatory lol
|
|
#1 black
|
|
#2 brown
|
|
#3 blonde
|
|
#4 ginger
|
|
#(ENEMIES ONLY) 5 white
|
|
stubble = 1 #basically the beard style
|
|
#1 no beard
|
|
#2 stubble
|
|
#3 short mustache
|
|
#4 mustache
|
|
#5 goatee
|
|
#6 full beard
|
|
haircoloroffset = -9 #this is by how many pixels does the y level on the sprite move for the hair n stubble to change
|
|
stubbleoffset = -4 #same thing as above just for the stubble
|
|
haircolormodifier = 0#this multiplies the hair color offset (read comment on haircoloroffset to find out more)
|
|
ticksanimation=10 #this is what the characters features move when being animated in level 3,
|
|
#also it makes the animation work by multiplying by 2 and moving the sprite a bit on the other side
|
|
canyoutypethename = False #if this is true you can type out the name in level 3
|
|
availablepoints = 9 #this is how many points you have for skills to upgrade
|
|
# PLAYER STATS - ALL SELF EXPLANATORY - NO COMMENTS NEEDED
|
|
playerstrength = 1
|
|
playeragility = 1
|
|
playerattack = 1
|
|
playerdefense = 1
|
|
playervitality = 1
|
|
playercharisma = 1
|
|
playerstamina = 1
|
|
playermagicka = 1
|
|
blocked1, blocked0 = False, False
|
|
|
|
enemyhealth, enemymana = 10, 100
|
|
|
|
playermana = 90 + playerstamina * 20 #this is the players mana, calculated from stamina
|
|
playerhealth = 10 + playervitality * 20 #this is the players health, calculated from vitality
|
|
#player default stats - used for resetting
|
|
def player_reset():
|
|
global playerstrength, playeragility, playerattack, playerdefense, playervitality, playercharisma, playerstamina, playermagicka, availablepoints, active_acceleration, player_height, player_width, playerX, playerY, player_active, playername, skincolor, haircolor, hairstyle, stubble, stubbleoffset
|
|
playerstrength = 1
|
|
playeragility = 1
|
|
playerattack = 1
|
|
playerdefense = 1
|
|
playervitality = 1
|
|
playercharisma = 1
|
|
playerstamina = 1
|
|
playermagicka = 1
|
|
availablepoints = 9
|
|
player_height, player_width = 50, 50 # size of the original player sprite (not used, only in prototype) DELETE LATER
|
|
playerX, playerY = 100, 100 # position of the player
|
|
playername = "" # self explanatory lmao
|
|
skincolor = 1 # just the skin color of the player
|
|
hairstyle = 1 # self explanatory isnt it
|
|
haircolor = 1 # also self explanatory lol
|
|
stubble = 1 # basically the beard style
|
|
stubbleoffset = -4 # same thing as above just for the stubble
|
|
|
|
#sprite locations for exact player customisations
|
|
hangingx = 1887
|
|
blackhangingy = 1711
|
|
asianhangingy = 1746
|
|
whitehangingy = 1781
|
|
blacky,whitey,asiany = 1816, 1886, 1851
|
|
#this returns the y position on the sprite for each skin color
|
|
def getskincolory(skincolor=skincolor):
|
|
match skincolor:
|
|
case 1:
|
|
return whitey
|
|
case 2:
|
|
return asiany
|
|
case 3:
|
|
return blacky
|
|
case _:
|
|
return whitey
|
|
#this returns the y position on the sprite for each skin color for the hanging pose
|
|
def getskinhangingcolory():
|
|
match skincolor:
|
|
case 1:
|
|
return whitehangingy
|
|
case 2:
|
|
return asianhangingy
|
|
case 3:
|
|
return blackhangingy
|
|
def gethairstylex(hairstyle=hairstyle):
|
|
match hairstyle:
|
|
case 1:
|
|
return None
|
|
case 2:
|
|
return 1869
|
|
case 3:
|
|
return 1857
|
|
case 4:
|
|
return 1845
|
|
case 5:
|
|
return 1833
|
|
case _:
|
|
return None
|
|
def getstubblex(stubble=stubble):
|
|
match stubble:
|
|
case 1:
|
|
return None
|
|
case 2:
|
|
return 1821
|
|
case 3:
|
|
return 1809
|
|
case 4:
|
|
return 1797
|
|
case 5:
|
|
return 1785
|
|
case 6:
|
|
return 1773
|
|
case _:
|
|
return None
|
|
|
|
|
|
# DIALOGUE STUFF
|
|
dialognum = 1 #this is which dialogue line is being shown in each level
|
|
|
|
# GENERAL STUFF
|
|
textcolor = (0, 0, 0) #this because for some reason I cant just use (var, var, var) cuz it doesnt let me ffs
|
|
slowly_appearing_text = 0 #this basically goes up to 255 until its done so the text can slowly change color from black to white
|
|
unlimited_slappeartext = 0 #same thing as above just goes above the limit but is used for timings
|
|
clicked = False #pretty self explanatory too
|
|
lastclickpos = (0, 0) #pretty self explanatory again
|
|
level = 1 #current level, also self explanatory |