Skip to content

Commit 8032170

Browse files
authored
Merge pull request #274 from PanduhBeer/master
Updating Thelda
2 parents 5afcc91 + 712c03a commit 8032170

File tree

11 files changed

+557
-262
lines changed

11 files changed

+557
-262
lines changed

Thelda/Thelda.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import thumby
21
import gc
2+
import thumby
3+
gc.collect()
34
import json
5+
gc.collect()
46
from sys import path
57
path.append("/Games/Thelda")
68
# import thumbyHardware
79
import fonthandler
10+
gc.collect()
811
from player import Player
912
gc.collect()
1013
from enemycontroller import EnemyController
@@ -35,6 +38,7 @@ def loadgame():
3538
with open("/Games/Thelda/save.json", 'r') as savefile:
3639
thisdata = json.load(savefile)
3740
return thisdata
41+
gc.collect()
3842

3943
title_screen = bytearray([0,252,14,246,26,234,234,234,106,106,106,234,106,234,106,234,106,234,234,234,234,106,234,234,234,106,234,234,234,106,106,234,234,106,234,234,234,106,106,234,234,106,106,234,234,234,106,106,106,234,106,106,106,234,234,234,234,234,234,234,234,234,234,234,234,234,234,26,22,14,252,0,
4044
0,255,0,255,0,255,255,255,159,164,183,55,244,246,52,55,52,4,5,207,247,52,5,197,63,196,244,53,7,196,13,244,247,20,20,21,7,204,7,244,7,12,253,254,7,247,244,53,52,103,204,30,63,255,7,247,23,23,55,199,15,63,255,255,255,255,255,0,0,0,255,0,
@@ -115,7 +119,7 @@ def loadgame():
115119
thumby.display.fill(1) # Fill canvas to white
116120
scene_controller.build_scene(scene_controller.scene_x, scene_controller.scene_y, font_handler, thumby.display, enemy_controller)
117121
enemy_controller.populate_enemies(scene_controller)
118-
enemy_controller.move_enemies(scene_controller)
122+
enemy_controller.move_enemies(scene_controller, my_player)
119123
enemy_controller.attack(my_player)
120124
enemy_controller.display_loot(my_player, enemy_controller, thumby.display)
121125
if not my_player.swinging:
@@ -134,4 +138,4 @@ def loadgame():
134138
# print(f"Memory Free: {freemem}")
135139
# print(f"Keys used: {scene_controller.keys_used}")
136140
thumby.display.update()
137-
141+

Thelda/arcade_description.txt

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ It's dangerous to go alone!
77
Don't forget to grab your sword from the cave on the
88
starting map screen.
99

10-
Currently has six unique enemies.
10+
Now has nine unique enemies!
1111

1212
If you encounter an UNDER CONSTRUCTION screen,
1313
simply return the way you came.
@@ -25,13 +25,15 @@ and only if you're not attacking on impact.
2525
THIS IS A WORK IN PROGRESS AND IS UNFINISHED
2626

2727
The world isn't fully populated with enemies, the first
28-
dungeon is still unfinished. There is currently no actual
29-
goal for the player to accomplish. Right now, it's just an
30-
explorable sandbox.
28+
dungeon is still partially unfinished but now includes
29+
spike traps, gels, pushable blocks, a boss, and a
30+
heart container pickup as a reward. There is currently
31+
no actual other goal for the player to accomplish.
32+
Right now, it's mostly just an explorable sandbox.
3133

32-
SOON: The next update should include a larger world map,
33-
three more enemy types, pushable blocks, spike traps,
34-
Dungeon Boss 1 and working bow and arrows.
34+
SOON: The next update should include a larger world map,
35+
working bow and arrows, peahats, and two other enemies,
36+
the first Triforce piece, and Fairies.
3537

3638
FUTURE: Shops, loot changes, more enemies, more items,
3739
music and more sound effects.
@@ -40,7 +42,10 @@ music and more sound effects.
4042
The current state of this project has been reached without
4143
using any AI assistance, and is a labor of love and obsession.
4244

45+
A big thanks to anyone playing! Please feel free to find me
46+
on discord if you have any feedback.
47+
4348

4449
Author: PanduhBeer
45-
Version: 0.3.11
50+
Version: 0.3.2
4651

Thelda/bosses.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
from thumby import Sprite, display
2+
import gc
3+
from sys import path
4+
path.append("/Games/Thelda")
5+
from random import choice, randrange, randint
6+
7+
8+
class Aquamentus:
9+
def __init__(self, x, y, identity):
10+
self.identity = identity
11+
self.enemy_type = "aquamentus"
12+
self.x = x
13+
self.y = y
14+
self.damage = 1
15+
self.starting_health = 6
16+
self.health = 6
17+
self.frozen = False
18+
self.is_dead = False
19+
self.attack_speed = 199
20+
self.magic = []
21+
self.prespawn = False
22+
self.walk_distance = 0
23+
self.direction = -1
24+
self.blank_map = bytearray([255,255,255,255,255,255,255,255,255,255,
25+
3,3,3,3,3,3,3,3,3,3])
26+
self.prespawn_map = bytearray([25,233,242,252,224,222,95,219,231,15,
27+
3,0,1,2,2,2,2,0,1,2])
28+
self.prespawn_mask = bytearray([230,246,255,255,255,225,224,228,248,240,
29+
0,1,3,1,1,1,1,3,3,1])
30+
self.has_fired = False
31+
self.pick_new_direction_and_distance()
32+
self.move_tick = 0
33+
self.spawn_animation_counter = 0
34+
35+
def pick_new_direction_and_distance(self):
36+
self.direction = choice([-1, 1])
37+
self.walk_distance = randint(1, 6)
38+
self.target_x = self.x + self.direction * self.walk_distance
39+
if self.direction == -1:
40+
self.target_x = max(35, self.target_x)
41+
else:
42+
self.target_x = min(55, self.target_x)
43+
44+
def move(self):
45+
# Move every 4 ticks
46+
if self.move_tick == 0:
47+
if self.direction == -1:
48+
self.x = max(35, self.x - 1)
49+
else:
50+
self.x = min(55, self.x + 1)
51+
52+
if self.x == self.target_x or (self.direction == -1 and self.x == 35) or (self.direction == 1 and self.x == 55):
53+
self.pick_new_direction_and_distance()
54+
55+
self.move_tick = (self.move_tick + 1) % 4
56+
57+

Thelda/dungeons1.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from random import randint
2-
2+
from thumby import Sprite
3+
from items import Heart_Container
34
class NSDoorway:
45
def __init__(self, x, y):
56
self.doorway = bytearray([31,31,31,31,31,31])
@@ -33,11 +34,8 @@ def __init__(self, x, y, identity):
3334
self.y = y
3435
self.size_x = 5
3536

36-
3737
class Scenes80:
3838
def __init__(self):
39-
40-
4139
self.scenes = {
4240
"scene -797,404": {
4341
"barriers": [(1, 5), (6, 5), (11, 5), (16, 5), (21, 5), (26, 5), (31, 5), (36, 5), (41, 5), (46, 5), (51, 5), (56, 5), (61, 5), (66, 5),
@@ -82,7 +80,9 @@ def __init__(self):
8280
"blocks": [(46, 10), (51, 10), (56, 10), (61, 10),
8381
(56, 15), (61, 15),
8482
(56, 25), (61, 25),
85-
(46, 30), (51, 30), (56, 30), (61, 30)],
83+
(46, 30), (51, 30), (56, 30), (61, 30)],
84+
"items": [Heart_Container(55, 20, "HC01")],
85+
"enemies": {"aquamentus": [(45, 15, "D1E39")]}
8686
},
8787

8888
"scene -799,400": {
@@ -236,7 +236,9 @@ def __init__(self):
236236
(1, 30), (66, 30),
237237
(1, 35), (6, 35), (11, 35), (16, 35), (21, 35), (26, 35), (41, 35), (46, 35), (51, 35), (56, 35), (61, 35), (66, 35)],
238238
"doorways": [EWDoorway(1, 20), EWDoorway(66, 20), NSDoorway(33, 35)],
239-
"blocks": [(31, 20)]
239+
"pushableblocks": [(31, 20, "left", "D1PB01")],
240+
"blocklocks": [(1, 20, "D1PB01", "EW")],
241+
"enemies": {"gel": [("D1E32"), ("D1E33"), ("D1E34")]},
240242
},
241243

242244
"scene -801,405": {
@@ -248,8 +250,11 @@ def __init__(self):
248250
(1, 35), (6, 35), (11, 35), (16, 35), (21, 35), (26, 35), (41, 35), (46, 35), (51, 35), (56, 35), (61, 35), (66, 35),
249251
(33, 5), (33, 35), (1, 20)],
250252
"doorways": [EWDoorway(66, 20)],
251-
"blocks": [(36, 15), (31, 20), (41, 20), (36, 25)],
252-
"stairs": [(36, 20)]
253+
"blocks": [(36, 15), (41, 20), (36, 25)],
254+
"doors": [(36, 20)],
255+
"stairs": [(36, 20)],
256+
"pushableblocks": [(31, 20, "down", "D1PB02")],
257+
"enemies": {"blade": [(6, 10, 25, 7, "D1E35"), (60, 10, 25, 7, "D1E36"), (6, 30, 25, 7, "D1E37"), (60, 30, 25, 7, "D1E38")]},
253258
},
254259

255260
"scene -801,400": {

0 commit comments

Comments
 (0)