Skip to content

Commit

Permalink
Merge branch 'new_pyland' of https://github.com/pyland/pyland into ne…
Browse files Browse the repository at this point in the history
…w_pyland
  • Loading branch information
YLGH committed Sep 2, 2015
2 parents cd99a74 + 55bb40e commit e57bf70
Show file tree
Hide file tree
Showing 10 changed files with 252 additions and 151 deletions.
56 changes: 56 additions & 0 deletions docs/design/Demo plan.txt
@@ -0,0 +1,56 @@
Demo Plan

Game Quest Goal:
Work with Myla to save people with scripts
Crocodiles have been reaking havoc in player's village, bring peace
(Myla on a quest to find snake in the jungle)

Introduce programming concepts gradually in the level, and reinforce them

Level 1 (Movement with arrow keys and talking to things)
-Pick up PyScripter

Level 2 (Running scripts)
- Solving puzzles with crododiles by yelling
- Similar to current Level 4

Level 3 (Movement scripts)
- Learn how to move with the scripter
- Script NPCs to move to stop blocking the path by fixing their scripts

Level 4 (Movement and yell scripts)
- Write simple movement and yell scripts for the NPCs
- Similar puzzle to previous level

Level 5 (Printing)
- Simple dungdeon/jungle with multiple paths
- Can read message from sign with PyScripter and print to terminal
- (or can read with enter, but need to use decipher function)

Level 6 (Vines)
- Cutting down vines
- Using print to display how cuts your knife has left

Level 7
- NPC puzzle with movement/crocodiles/vines

Level 8 (Loops)
- Simple introduction to loops (given to you)
- ie moving long distances

Level 9 (Fixing loops)
- Fix NPC loop scripts to solve puzzle

World 2

Level 1
- NPC puzzle invovling writing your own scripts

Level 2
- Introduce conditionals

Demo later level

Maze level


20 changes: 20 additions & 0 deletions game/engine/engine.py
Expand Up @@ -483,6 +483,26 @@ def run_callback_list_sequence(self, callback_list_sequence, callback = lambda:
return


def hide_bag(self, callback = lambda: None):
""" Hides the bag icon from the top right of the screen
Parameters
----------
callback : func, optional
Places the callback onto the engine
"""
self.__cpp_engine.hide_bag(callback)

def unhide_bag(self, callback = lambda: None):
""" Shows the bag icon from the top right of the screen
Parameters
----------
callback : func, optional
Places the callback onto the engine
"""
self.__cpp_engine.unhide_bag(callback)

def disable_py_scripter(self, callback = lambda: None):
""" Disables the PyScritpter
Expand Down
1 change: 1 addition & 0 deletions game/levels/start_screen/scripts/start.py
Expand Up @@ -6,6 +6,7 @@
from script_state_container import ScriptStateContainer

camera.focus()
engine.hide_bag()
engine.clear_scripter()
c1 = (210, 210, 210)
c2 = (190, 190, 190)
Expand Down
4 changes: 2 additions & 2 deletions game/levels/world_1/intro/scripts/start.py
@@ -1,11 +1,11 @@
camera.focus()

import sys
import json

sys.path.insert(1, engine.get_config()['files']['script_running_location'])
from script_state_container import ScriptStateContainer

camera.focus()
engine.hide_bag()
config = engine.get_config()

c1 = (210, 210, 210)
Expand Down
2 changes: 1 addition & 1 deletion game/levels/world_1/level_1/player_house/scripts/start.py
Expand Up @@ -27,4 +27,4 @@
def go_to_village(player_object):
player_data.save_and_exit("/world_1/level_1/rossumberg")

exit_to_village.player_walked_on = go_to_village
exit_to_village.player_walked_on = lambda player_one: engine.change_map("world_1/level_1/rossumberg")#go_to_village

0 comments on commit e57bf70

Please sign in to comment.