Add some classes

master
GreenXenith 2020-02-12 11:26:41 -08:00
parent b768a29c3e
commit 90c6cfa6f6
6 changed files with 26 additions and 0 deletions

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"python.pythonPath": "C:\\Users\\mc146uxx\\AppData\\Local\\Programs\\Python\\Python37-32\\python.exe"
}

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,7 @@
import pygame
import os
from pygame.locals import *
from player import Player
# Init
pygame.init()
@ -42,6 +43,8 @@ player = {
"rect": textures["CHARACTER"].get_rect()
}
test_player = Player()
# Mainloop
time = pygame.time.get_ticks()
while 1:

12
player.py Normal file
View File

@ -0,0 +1,12 @@
from sprite import Sprite
class Player:
x = 0
y = 0
hp = 100
mp = 50
xp = 0
sprite = Sprite()
sprite.set_texture("character.png")

8
sprite.py Normal file
View File

@ -0,0 +1,8 @@
class Sprite:
x = 0
y = 0
texture = ""
def set_texture(self, filename):
self.texture = filename