generated from dvorakmortonxd/pygame-template
first sprite, making up the theme, some slight adjustments to differ from the pygame template, etc.
This commit is contained in:
parent
e31878c4cc
commit
731ba1053e
5 changed files with 7 additions and 5 deletions
|
|
@ -21,3 +21,4 @@ You control the weather to your liking, just be aware, it can turn against you!
|
|||
# Credits
|
||||
|
||||
Here I will list all the external resources I will use, most likely, fonts. I make most of my assets by my own.
|
||||
Alright so I think its fair to state I stole some code from my last minijam project at https://git.dvorakmortonxd.dev/dvorakmortonxd/revival-inc , however I dont know if this counts as external resource since, I am literally the one who wrote it.
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
from render import load_sprite # this makes it so our function for rendering sprites from sprites.png is available in here
|
||||
|
||||
def level1(screen, sheet, lastclickpos, basicfont, mouse, click, level): # the function for our first level, ignore the unused variables here, you can use them when you edit it
|
||||
screen.blit(load_sprite(sheet, 0, 0, 26, 8, 210, 60), (200, 200)) # this renders a button I made in the sprites.png, its purely for visual purposes so it doesnt matter where you click rn
|
||||
screen.blit(load_sprite(sheet, 0, 0, 57, 36, 912, 576), (0, 0)) # this renders a button I made in the sprites.png, its purely for visual purposes so it doesnt matter where you click rn
|
||||
if click: # this checks if you clicked, when you clicked it does the following stuff under
|
||||
level = 2 # sets the level to 2
|
||||
print("yo") # prints out "yo" for debugging purposes, otherwise completely unnecessary
|
||||
|
|
|
|||
7
main.py
7
main.py
|
|
@ -5,9 +5,10 @@ window_fps = 60 # the frames per second, this decides how fast the main loop ru
|
|||
|
||||
def main(fps=window_fps): # the main function
|
||||
pygame.init() # initalizes pygame
|
||||
screen_width = 800 # the screen width
|
||||
screen_height = 500 # the screen height
|
||||
title = "Example Title" # the title of the window obviously
|
||||
screen_width = 912 # the screen width
|
||||
screen_height = 576 # the screen height
|
||||
# THE SCREEN IS 19:12 RATIO
|
||||
title = "The Destroyer of Cities" # the title of the window obviously
|
||||
lastclickpos = [0, 0] # last position that was clicked, this changes every time you click somewhere on the game window
|
||||
screen = pygame.display.set_mode((screen_width, screen_height)) # this initalizes the display with the screen_width and screen_height variables
|
||||
pygame.display.set_caption(title) # this actually sets the title of the window from the title variable
|
||||
|
|
|
|||
BIN
sprites.png
BIN
sprites.png
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 5.7 KiB |
BIN
sprites.pxo
BIN
sprites.pxo
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue