import os
from enum import IntEnum

FPS = 60
SCALE = 3.0
TILE_SIZE = 16
GAME_TILE_SIZE = int(TILE_SIZE * SCALE)
STATUS_HEIGHT = 50
SPRITE_COLOR_KEY = (146, 144, 255)


class Ids(IntEnum):
    mario = 0
    star = 26
    land = 32
    hard_block = 33
    brick_block = 34
    empty_block = 35


class Actions(IntEnum):
    noop = 0
    left = 1
    right = 2
    jump = 3


MARIO_IDLE_THRESHOLD = 10.0
MARIO_GROUND_MAX_SPEED = 750.0
MARIO_AIR_MAX_SPEED = 500.0
MARIO_MIN_ANIM_INTERVAL, MARIO_MAX_ANIM_INTERVAL = 0.005, 0.1
MARIO_INVINCIBLE_TIME = 10.0
MARIO_INVINCIBLE_ANIM_INTERVAL = 0.05
MARIO_FRICTION = 0.90
MARIO_INVINCIBLE_FRAMES = 4
MARIO_GRAVITY = 2000.0

MARIO_DEFAULT_MOVING_FORCE = 75.0
MARIO_MAX_MOVING_FORCE = 100.0
MARIO_DEFAULT_FLOATING_FORCE = 50.0
MARIO_MAX_FLOATING_FORCE = 75.0
MARIO_JUMPING_FORCE = 1000.0
MARIO_HOP_FORCE = 500.0

MARIO_COLOR_SKIN = 234, 158, 34
MARIO_COLOR_SHIRT = 181, 49, 32
MARIO_COLOR_INNER = 107, 109, 0

MARIO_COLOR_SKIN_LIGHT = 254, 204, 197
MARIO_COLOR_SKIN_WHITE = 255, 254, 255

MARIO_COLOR_SHIRT_GREEN = 12, 147, 0
MARIO_COLOR_SHIRT_RED = 181, 49, 32
MARIO_COLOR_SHIRT_BLACK = 0, 0, 0

MARIO_COLOR_INNER_ORANGE = 234, 158, 34
MARIO_COLOR_INNER_BROWN = 153, 78, 0

BULLET_BILL_MIN_SPEED = 200.0
BULLET_BILL_MAX_SPEED = 300.0
BULLET_BILL_FALLEN_SPEED = 700.0
STAR_ANIM_INTERVAL = 0.05

PATH_SPRITE = os.path.join(os.path.dirname(__file__), 'assets', 'sprite.png')
FILE_OBJECT = '_object.csv'
FILE_BACKGROUND = '_background.csv'

OFFSET_MARIO_STAND = 0, 0
OFFSET_MARIO_WALK = [(16, 0), (32, 0), (48, 0)]
OFFSET_MARIO_JUMP = 64, 0
OFFSET_MARIO_DEAD = 160, 0

OFFSET_BULLET_BILL = 96, 16

OFFSET_STAR = [(0, 32), (16, 32), (32, 32), (48, 32)]



