-
Notifications
You must be signed in to change notification settings - Fork 0
/
Navigator.py
53 lines (36 loc) · 1.84 KB
/
Navigator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import pygame
class Navigator(object):
def __init__(self):
self.Pfeil_oben = pygame.image.load("Assets/Pfeil_oben.png")
self.Pfeil_unten = pygame.image.load("Assets/Pfeil_unten.png")
self.Pfeil_rechts = pygame.image.load("Assets/Pfeil_rechts.png")
self.Pfeil_links = pygame.image.load("Assets/Pfeil_links.png")
self.Pfeil_oben_links = pygame.image.load("Assets/Pfeil_oben_links.png")
self.Pfeil_oben_rechts = pygame.image.load("Assets/Pfeil_oben_rechts.png")
self.Pfeil_unten_links = pygame.image.load("Assets/Pfeil_unten_links.png")
self.Pfeil_unten_rechts = pygame.image.load("Assets/Pfeil_unten_rechts.png")
self.nichts = pygame.image.load("Assets/Durchsichtig.png")
self.IMG = self.nichts
def navigiere(self,screen,actual_chunkx,actual_chunky,zielx,ziely):
if zielx != 9999 and zielx != 9999:
if actual_chunkx < zielx and actual_chunky < ziely:
self.IMG = self.Pfeil_unten_rechts
elif actual_chunkx > zielx and actual_chunky < ziely:
self.IMG = self.Pfeil_unten_links
elif actual_chunkx < zielx and actual_chunky > ziely:
self.IMG = self.Pfeil_oben_rechts
elif actual_chunkx > zielx and actual_chunky > ziely:
self.Pfeil_oben_links
elif actual_chunkx < zielx:
self.IMG = self.Pfeil_rechts
elif actual_chunkx > zielx:
self.IMG = self.Pfeil_links
elif actual_chunky < ziely:
self.IMG = self.Pfeil_unten
elif actual_chunky > ziely:
self.IMG = self.Pfeil_oben
else:
self.IMG = self.nichts
if zielx == 9999 and ziely == 9999:
self.IMG = self.nichts
screen.blit(self.IMG,(480,20))