Removed pygame-menu and code cleanup

Added game class
This commit is contained in:
2024-02-06 22:28:14 +01:00
parent caad5c9dbc
commit 2a60195960
6 changed files with 163 additions and 106 deletions

View File

@@ -1,6 +1,7 @@
import pygame
import random as rand
class GameObject():
"""TODO Install a body array with positions of mainbody and adders"""
@@ -175,6 +176,7 @@ class Player(GameObject_new):
self.__snake_body = [[100,100+size], [100,100+size*2], [100,100+size*3], [100,size*5]]
super().__init__(name, surface, surface_size, init_pos_x, init_pos_y, visibility)
self.__snake = {"head":"data/models/snake_head_1.png", "body":"data/models/snake_body_1.png", "tail":""}
self._startmoving = False
__movedirection = {"up":False, "down":False, "left":False, "right":False}
@@ -253,6 +255,8 @@ class Player(GameObject_new):
image = pygame.image.load(self.__snake["body"])
image = pygame.transform.scale(image, (30,40))
image = pygame.transform.rotate(image, 270)
surface.blit(image, (0,5))
self._surface.blit(surface, (pos[0], pos[1]))
#print((pos[0], pos[1]))