Skip to content

Commit

Permalink
Merge pull request #200 from pygamelib/master
Browse files Browse the repository at this point in the history
Merging back minor changes
  • Loading branch information
arnauddupuis committed Oct 16, 2022
2 parents e93024f + 1e71f81 commit 683af6b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A (not so) small library for terminal based game development.

## Preemptive warning

Version updates always bare the possibility of bringing some breaking changes together with new features and improvements. We try to limit these but when they do occur they are documented [on the wiki]([/wiki#migration-notes](https://github.com/pygamelib/pygamelib/wiki#migration-notes)).
Version updates always bare the possibility of bringing some breaking changes together with new features and improvements. We try to limit these but when they do occur they are documented [on the wiki](https://github.com/pygamelib/pygamelib/wiki#migration-notes).

## Introduction

Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/01-game-basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def update_game(game: engine.Game, key, elapsed_time):
)
# Then we create 2 basic boards. Please have a look at the wiki for a complete
# tutorial on Boards:
# https://github.com/arnauddupuis/pygamelib/wiki/Getting-started-Board
# https://github.com/pygamelib/pygamelib/wiki/Getting-started-Board
# And the documentation for the Board class:
# https://pygamelib.readthedocs.io/en/latest/pygamelib.engine.Board.html
board1 = engine.Board(
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/02-move-player.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def update_game(game: engine.Game, key, elapsed_time):
)
# Then we create 2 basic boards. Please have a look at the wiki for a complete
# tutorial on Boards:
# https://github.com/arnauddupuis/pygamelib/wiki/Getting-started-Board
# https://github.com/pygamelib/pygamelib/wiki/Getting-started-Board
# And the documentation for the Board class:
# https://pygamelib.readthedocs.io/en/latest/pygamelib.engine.Board.html
board1 = engine.Board(
Expand Down
15 changes: 11 additions & 4 deletions examples/tutorials/03-gmighty-wizard/99-final-game.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ def whale_behavior():
# their type.
# This matches both "left_whale" and "right_whale"
for item in g.current_board().get_movables(type="whale"):
item.sprixel.bg_color = core.Color(124, 183, 255)
if item.type == "right_whale" or item.type == "left_whale":
whales.append(item)
if len(whales) > 0:
Expand All @@ -223,7 +224,8 @@ def whale_behavior():
1,
board_items.NPC(
sprixel=core.Sprixel(
graphics.Models.OCTOPUS, core.Color(0, 0, 255)
graphics.Models.OCTOPUS,
core.Color(124, 183, 255),
),
name="Swimming Octopus (Left)",
item_type="swimming_octopus",
Expand All @@ -238,7 +240,8 @@ def whale_behavior():
1,
board_items.NPC(
sprixel=core.Sprixel(
graphics.Models.OCTOPUS, core.Color(0, 0, 255)
graphics.Models.OCTOPUS,
core.Color(124, 183, 255),
),
name="Swimming Octopus (Right)",
item_type="swimming_octopus",
Expand Down Expand Up @@ -512,12 +515,16 @@ def teleport_player(row, column):
# Now let's place the 2 river tiles (we use the Door object as a shortcut to get a
# overlapable, restorable item)
g.current_board().place_item(
board_items.Door(sprixel=core.Sprixel.blue_square()), 0, 26
board_items.Door(sprixel=core.Sprixel(" ", core.Color(124, 183, 255))), 0, 26
)
g.current_board().place_item(
board_items.Door(sprixel=core.Sprixel.blue_square()), 11, 0
board_items.Door(sprixel=core.Sprixel(" ", core.Color(124, 183, 255))), 11, 0
)

for item in g.current_board().get_movables(type="whale"):
if item.type == "right_whale" or item.type == "left_whale":
item.sprixel.bg_color = core.Color(124, 183, 255)

# Now we need to take care of the explosions. Hide them and set the callback functions.
for item in g.current_board().get_immovables():
# Here we need to set the functions that are going to be called when the player
Expand Down

0 comments on commit 683af6b

Please sign in to comment.