Browse Source

is this the end?

master
enp0s25 2 months ago
parent
commit
186a04272e
  1. BIN
      assets/other/descartes.png
  2. BIN
      assets/other/matrix.png
  3. BIN
      assets/other/matrix_bg.png
  4. BIN
      assets/other/matrix_intro.png
  5. BIN
      assets/other/matrix_intro2.png
  6. BIN
      assets/other/neo.jpeg
  7. BIN
      assets/other/neo.png
  8. BIN
      assets/other/real_neo.png
  9. BIN
      assets/other/sokrates2~.png
  10. BIN
      assets/other/sokrates~.png
  11. BIN
      assets/psd/smith.jpeg
  12. BIN
      assets/psd/smith.png
  13. 3
      game.py
  14. BIN
      maps/large.bin
  15. 9
      modules/GameObject.py
  16. 3
      modules/map_utils.py
  17. 148
      modules/tasks.py
  18. 2
      todo.md
  19. 3
      tools/map_convert.py

BIN
assets/other/descartes.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 KiB

BIN
assets/other/matrix.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
assets/other/matrix_bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 995 KiB

BIN
assets/other/matrix_intro.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
assets/other/matrix_intro2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
assets/other/neo.jpeg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 470 KiB

BIN
assets/other/neo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 616 KiB

BIN
assets/other/real_neo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
assets/other/sokrates2~.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 840 KiB

BIN
assets/other/sokrates~.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 744 KiB

BIN
assets/psd/smith.jpeg

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 KiB

BIN
assets/psd/smith.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

3
game.py

@ -44,7 +44,8 @@ def main(screen, settings): @@ -44,7 +44,8 @@ def main(screen, settings):
"Matrix": 0,
"Osvietenci": 0,
"Marx": 0,
"Swim": 0
"Swim": 0,
"Nastenka": 0
}
# game main loop

BIN
maps/large.bin

Binary file not shown.

9
modules/GameObject.py

@ -9,9 +9,9 @@ TEXTURE_SIZE = 64 @@ -9,9 +9,9 @@ TEXTURE_SIZE = 64
# PLAYER_IMG_DIR = "assets/player/MC/"
WALL_IMG_DIR = "assets/resized/"
wall_images_count = 45
wall_images_count = 47
wall_images = []
bind_special_img = ((39, 40), (12, 23))
bind_special_img = ((39, 40), (12, 23), (46, 45))
settings = {}
screen = None
@ -29,11 +29,12 @@ special_mappings = { @@ -29,11 +29,12 @@ special_mappings = {
"Diogenes": tasks.Diogenes,
"Pytagoras": tasks.Pytagoras,
"Atomisti": tasks.Atomisti,
"Matrix": tasks.WinDosXD,
"Matrix": tasks.Matrix,
"Sokrates": tasks.Sokrates,
"Osvietenci": tasks.Osvietenci,
"Marx": tasks.WinDosXD,
"Swim": tasks.WinDosXD
"Swim": tasks.WinDosXD,
"Nastenka": tasks.GrellNetAP
}
class GameObject(pygame.sprite.Sprite):

3
modules/map_utils.py

@ -19,7 +19,8 @@ def wall_chunk_load(walls): @@ -19,7 +19,8 @@ def wall_chunk_load(walls):
"41": "Matrix",
"42": "Osvietenci",
"43": "Marx",
"44": "Swim"
"44": "Swim",
"46": "Nastenka"
}
# go through 2d array

148
modules/tasks.py

@ -566,7 +566,155 @@ class Atomisti: @@ -566,7 +566,155 @@ class Atomisti:
pygame.display.update()
class Matrix:
'''Bullet time with Mr. Descartes and Mr. Smith'''
def __init__(self, screen, settings, clock):
self.settings = settings
self.screen = screen
self.clock = clock
self.player_img = pygame.image.load("assets/other/real_neo.png")
self.img_intro = pygame.image.load("assets/other/matrix_intro2.png")
self.img_bg = pygame.image.load("assets/other/matrix_bg.png")
self.name = "Matrix"
self.task_type = "Matrix"
self.done = False
def matrix(self):
player_pos = [self.settings['window_size'][0]//2, self.settings['window_size'][1]//2]
controls = self.settings['controls']
walk_r = False
walk_l = False
walk_d = False
walk_u = False
player_rect = self.player_img.get_rect()
bullets = []
bullet = {
"x": 0,
"y": 0,
"vx": 0,
"vy": 0,
"rect": pygame.rect.Rect(0, 0, 20, 20)
}
while not self.done:
self.clock.tick(self.settings['FPS'])
# parse events
for event in pygame.event.get():
# check if window is closed
if event.type == pygame.QUIT:
sys.exit()
# check if a key was pressed
elif event.type == pygame.KEYDOWN:
if event.type == pygame.KEYDOWN:
if event.key in controls['right']:
walk_r = True
if event.key in controls['left']:
walk_l = True
if event.key in controls['down']:
walk_d = True
if event.key in controls['up']:
walk_u = True
# exit task when ESC is pressed
if event.key == pygame.K_ESCAPE:
# status 1 indicates task isn't finished
return 1
# check if a key was released
elif event.type == pygame.KEYUP:
if event.key in controls['right']:
walk_r = False
if event.key in controls['left']:
walk_l = False
if event.key in controls['down']:
walk_d = False
if event.key in controls['up']:
walk_u = False
player_pos[0] += 15 if walk_r else 0
player_pos[0] -= 15 if walk_l else 0
player_pos[1] += 15 if walk_d else 0
player_pos[1] -= 15 if walk_u else 0
player_rect.x = player_pos[0]
player_rect.y = player_pos[1]
if player_pos[0] < 0:
player_pos[0] = 0
elif player_pos[0] > self.settings['window_size'][0] - self.player_img.get_width():
player_pos[0] = self.settings['window_size'][0] - self.player_img.get_width()
if player_pos[1] < 0:
player_pos[1] = 0
elif player_pos[1] > self.settings['window_size'][1] - self.player_img.get_height():
player_pos[1] = self.settings['window_size'][1] - self.player_img.get_height()
# draw stuff into task window
task_window = pygame.Surface((self.settings['window_size'][0], self.settings['window_size'][1]))
task_window.fill((255,0,0))
task_window.blit(self.img_bg, (0,0))
task_window.blit(self.player_img, player_pos)
# blit task window on screen
self.screen.blit(task_window, (0,0))
pygame.display.update()
def do_task(self, results):
'''open screen with task'''
dialog1_texts = [
"Smith: We meet again Mr. Descartes.",
"Descartes: Oh hi! What a lovely sunny day, isn't it?",
"Smith: Huh? Are you aware that you are inside a computer? There is no sun in here!",
"Smith: Seriously, it is time for you to wake up into reality!"
]
dialog1_done = False
dialog1_index = 0
# main loop of task
while not self.done:
self.clock.tick(self.settings['FPS'])
# parse events
for event in pygame.event.get():
# check if window is closed
if event.type == pygame.QUIT:
exit_sig = True
sys.exit()
# check if a key was pressed
elif event.type == pygame.KEYDOWN:
# exit task when ESC is pressed
if event.key == pygame.K_ESCAPE:
# status 1 indicates task isn't finished
return 1
# check if a key was released
elif event.type == pygame.KEYUP:
if event.key in self.settings['controls']['right']:
pass
elif event.type == pygame.MOUSEBUTTONDOWN:
if not dialog1_done:
if dialog1_index < len(dialog1_texts) - 1:
dialog1_index += 1
else:
dialog1_done = True
self.matrix()
return 0
elif event.type == pygame.MOUSEBUTTONUP:
pass
# draw stuff into task window
task_window = pygame.Surface((self.settings['window_size'][0], self.settings['window_size'][1]))
task_window.fill((255,0,0))
task_window.blit(self.img_intro, (0,0))
# blit task window on screen
if not dialog1_done:
display_text(self.settings, task_window, dialog1_texts[dialog1_index])
self.screen.blit(task_window, (0,0))
pygame.display.update()

2
todo.md

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
### Dialogue Smith & Descartes

3
tools/map_convert.py

@ -85,7 +85,8 @@ mappings = { @@ -85,7 +85,8 @@ mappings = {
'(250, 0, 0)': 41, # Matrix
'(249, 0, 0)': 42, # Locke
'(248, 0, 0)': 43, # Marx
'(247, 0, 0)': 44 # Student
'(247, 0, 0)': 44, # Student
'(255, 128, 0)': 46 # nastenka
}

Loading…
Cancel
Save