Add kenny assets and strip them down, add basic game and map, slippery ice, decoration and spikes, player animation, fix main menu button scaling

This commit is contained in:
csd4ni3l
2025-11-27 23:31:28 +01:00
parent 4fc55f4b64
commit 88f18b200d
23 changed files with 269 additions and 15 deletions

View File

@@ -3,6 +3,12 @@ from arcade.types import Color
from arcade.gui.widgets.buttons import UITextureButtonStyle, UIFlatButtonStyle
from arcade.gui.widgets.slider import UISliderStyle
FOLLOW_DECAY_CONST = 0.3
GRAVITY = 1.5
PLAYER_MOVEMENT_SPEED = 10
PLAYER_JUMP_SPEED = 28
GRID_PIXEL_SIZE = 70
menu_background_color = (30, 30, 47)
log_dir = 'logs'
discord_presence_id = 1443616900096590027

View File

@@ -5,4 +5,20 @@ _module_dir = os.path.dirname(os.path.abspath(__file__))
_assets_dir = os.path.join(os.path.dirname(_module_dir), 'assets')
button_texture = arcade.gui.NinePatchTexture(64 // 4, 64 // 4, 64 // 4, 64 // 4, arcade.load_texture(os.path.join(_assets_dir, 'graphics', 'button.png')))
button_hovered_texture = arcade.gui.NinePatchTexture(64 // 4, 64 // 4, 64 // 4, 64 // 4, arcade.load_texture(os.path.join(_assets_dir, 'graphics', 'button_hovered.png')))
button_hovered_texture = arcade.gui.NinePatchTexture(64 // 4, 64 // 4, 64 // 4, 64 // 4, arcade.load_texture(os.path.join(_assets_dir, 'graphics', 'button_hovered.png')))
def animation_from(path_list):
return arcade.TextureAnimation([
arcade.TextureKeyframe(arcade.load_texture(path))
for path in path_list
])
player_walk_animation = animation_from([os.path.join(_assets_dir, 'graphics', 'KenneyNewPlatformerPack', 'character', 'character_green_walk_a.png'), os.path.join(_assets_dir, 'graphics', 'KenneyNewPlatformerPack', 'character', 'character_green_walk_b.png')])
player_still_animation = animation_from([os.path.join(_assets_dir, 'graphics', 'KenneyNewPlatformerPack', 'character', 'character_green_idle.png')])
player_jump_animation = animation_from([os.path.join(_assets_dir, 'graphics', 'KenneyNewPlatformerPack', 'character', 'character_green_jump.png')])
player_duck_animation = animation_from([os.path.join(_assets_dir, 'graphics', 'KenneyNewPlatformerPack', 'character', 'character_green_duck.png')])
background_sound = arcade.Sound(os.path.join(_assets_dir, "sound", "background.mp3"))
freeze_sound = arcade.Sound(os.path.join(_assets_dir, "sound", "freeze.wav"))
tile_map = arcade.load_tilemap(os.path.join(_assets_dir, "map.tmx"))