mirror of
https://github.com/n0remac/game-jam-2020.git
synced 2025-12-10 10:05:22 -06:00
create new config class for organizing constants
This commit is contained in:
23
triple-dungeon/config.py
Normal file
23
triple-dungeon/config.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
class Config(object):
|
||||||
|
"""
|
||||||
|
A simple class dedicated to loading, storing and organizing constants.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Constants
|
||||||
|
SCREEN_WIDTH = 1000
|
||||||
|
SCREEN_HEIGHT = 650
|
||||||
|
SCREEN_TITLE = "Triple Dungeon"
|
||||||
|
|
||||||
|
# Constants used to scale our sprites from their original size
|
||||||
|
CHARACTER_SCALING = 1
|
||||||
|
TILE_SCALING = 2
|
||||||
|
|
||||||
|
# Movement speed of player, in pixels per frame
|
||||||
|
PLAYER_MOVEMENT_SPEED = 5
|
||||||
|
|
||||||
|
# How many pixels to keep as a minimum margin between the character
|
||||||
|
# and the edge of the screen.
|
||||||
|
LEFT_VIEWPORT_MARGIN = 250
|
||||||
|
RIGHT_VIEWPORT_MARGIN = 250
|
||||||
|
BOTTOM_VIEWPORT_MARGIN = 50
|
||||||
|
TOP_VIEWPORT_MARGIN = 100
|
||||||
@@ -1,29 +1,5 @@
|
|||||||
"""
|
|
||||||
Platformer Game
|
|
||||||
"""
|
|
||||||
import arcade
|
import arcade
|
||||||
|
|
||||||
# Constants
|
|
||||||
SCREEN_WIDTH = 1000
|
|
||||||
SCREEN_HEIGHT = 650
|
|
||||||
SCREEN_TITLE = "Triple Dungeon!!!"
|
|
||||||
|
|
||||||
# Constants used to scale our sprites from their original size
|
|
||||||
CHARACTER_SCALING = 1
|
|
||||||
TILE_SCALING = 2
|
|
||||||
|
|
||||||
# Movement speed of player, in pixels per frame
|
|
||||||
PLAYER_MOVEMENT_SPEED = 5
|
|
||||||
|
|
||||||
|
|
||||||
# How many pixels to keep as a minimum margin between the character
|
|
||||||
# and the edge of the screen.
|
|
||||||
LEFT_VIEWPORT_MARGIN = 250
|
|
||||||
RIGHT_VIEWPORT_MARGIN = 250
|
|
||||||
BOTTOM_VIEWPORT_MARGIN = 50
|
|
||||||
TOP_VIEWPORT_MARGIN = 100
|
|
||||||
|
|
||||||
|
|
||||||
class MyGame(arcade.Window):
|
class MyGame(arcade.Window):
|
||||||
"""
|
"""
|
||||||
Main application class.
|
Main application class.
|
||||||
|
|||||||
Reference in New Issue
Block a user