Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cursesman/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def __init__(self, x, y, col=1):
self.lives = 3
self.score = 0
self.owner = self.uuid

self.detonator = False
def central_render(self, stdscr, px, py):
#always draw the player at the same location
self.sprite.render(stdscr, playerXDraw, playerYDraw, col=self.col)
Expand All @@ -374,6 +374,7 @@ def get_hashed_attributes(self):
'wallpass': self.wallpass,
'bombpass': self.bombpass,
'flamepass': self.flamepass,
'detonator': self.detonator
}

def apply_attributes(self, attributes):
Expand All @@ -383,7 +384,7 @@ def apply_attributes(self, attributes):
self.wallpass = attributes.get('wallpass')
self.bombpass = attributes.get('bombpass')
self.flamepass = attributes.get('flamepass')

self.detonator = attributes.get('detonator')
if attributes.get('lives') < self.lives:
self.die()

Expand Down
5 changes: 4 additions & 1 deletion cursesman/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ def init_room_from_server(data):
player.bomb_power=5
player.flamepass = True
player.wallpass = True

render_iter = 0
while not game_over:
if debug_mode:
Expand Down Expand Up @@ -387,6 +386,10 @@ def init_room_from_server(data):
elif inp in [ord(' '), ord('e')]:
if nplayerbombs < player.max_bombs:
room.append(Bomb(player.x, player.y, col=player.col, power=player.bomb_power, owner=local_player_id))
elif inp in [ord('f'), ord('m')]:
if nplayerbombs > 0 and player.detonator:
bombs = [r for r in room if isinstance(r,Bomb)]
bombs[0].explode()


player.tick()
Expand Down
11 changes: 5 additions & 6 deletions cursesman/rooms.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from cursesman.entities import Pass, Balloom, Oneil, Doll, Powerup, Minvo, Kondoria, Pontan
rooms = [
('2345', 20, 14, [], Powerup('powerup_flames',0,0)),
('DEBUG', 20, 14, 1*[Minvo(0,0)] + 1*[Kondoria(0,0)] + 1*[Pontan(0,0)], Powerup('powerup_flames',0,0)),
('2345', 20, 14, 6*[Balloom(0,0)], Powerup('powerup_flames',0,0)),
('1234', 20, 14, 3*[Oneil(0,0)] + 3*[Balloom(0,0)], Powerup('powerup_bombs', 0, 0)),
('1234', 20, 14, (2*[Oneil(0,0)] + 2*[Balloom(0,0)] + 2*[Doll(0,0)]), Powerup('powerup_bombs',0,0))
('1', 20, 14, 1*[Balloom(0,0)], Powerup('powerup_flames',0,0)),
('2', 20, 14, 3*[Balloom(0,0)] + 3*[Oneil(0,0)] + 1*[Pontan(0,0)], Powerup('powerup_bombs',0,0)),
('3', 20, 14, 2*[Balloom(0,0)] + 2*[Oneil(0,0)] + 2*[Doll(0,0)], Powerup('powerup_detonator',0,0)),
('4', 20, 14, 1*[Balloom(0,0)] + 1*[Oneil(0,0)] + 2*[Doll(0,0)] + 2*[Minvo(0,0)], Powerup('powerup_speed', 0, 0)),
('5', 20, 14, 4*[Oneil(0,0)] + 3*[Doll(0,0)], Powerup('powerup_bombs',0,0))]

]
4 changes: 4 additions & 0 deletions cursesman/sprites/powerup_detonator/idle.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
X=X
=X=|
X=X|
---+
3 changes: 1 addition & 2 deletions cursesman/utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import ctypes
from cursesman.settings import MUSIC_DIR

from playsound import playsound
import threading


def play_sound(path):
k = lambda: playsound(str(MUSIC_DIR / path))
t = threading.Thread(target=k)
Expand All @@ -19,3 +17,4 @@ def loop_sound(path, length):
t = threading.Thread(target=k)
t.start()
return t