From b3dbbfc5147bf0ddf6a3315597f240c30acd2b66 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Tue, 14 Mar 2017 09:28:24 +0100 Subject: [PATCH 1/4] Updating basics and intermediate to use README conventions. --- basics/README.md | 16 ++++++++++++++++ basics/basics.md | 16 ---------------- intermediate/README.md | 10 ++++++++++ intermediate/intermediate.md | 10 ---------- 4 files changed, 26 insertions(+), 26 deletions(-) create mode 100644 basics/README.md delete mode 100644 basics/basics.md create mode 100644 intermediate/README.md delete mode 100644 intermediate/intermediate.md diff --git a/basics/README.md b/basics/README.md new file mode 100644 index 0000000..6c347e4 --- /dev/null +++ b/basics/README.md @@ -0,0 +1,16 @@ +#Cocos2D Python Basics +---------------------- + +Here is the order which the tutorial follows: + +1. Getting Started [start.py](start.py) +2. Adding Actors [actors.py](actors.py) +3. Basic Actions [actions.py](actions.py) +4. Keyboard Input [keyboard.py](keyboard.py) +5. Mouse Input [mouse.py](mouse.py) +6. Applying User Input [input.py](input.py) +7. Audio Playback [audio.py](audio.py) +8. Multiple Scene Games [scenes.py](scenes.py) +9. Transitioning Between Scenes [transition.py](transitions.py) +10. Effects [effects.py](effects.py) +11. Review [review.py](review.py) diff --git a/basics/basics.md b/basics/basics.md deleted file mode 100644 index 01f068c..0000000 --- a/basics/basics.md +++ /dev/null @@ -1,16 +0,0 @@ -#Cocos2D Python Basics ----------------------- - -Here is the order which the tutorial follows: - -1. Getting Started (start.py) -2. Adding Actors (actors.py) -3. Basic Actions (actions.py) -4. Keyboard Input (keyboard.py) -5. Mouse Input (mouse.py) -6. Applying User Input (input.py) -7. Audio Playback (audio.py) -8. Multiple Scene Games (scenes.py) -9. Transitioning Between Scenes (transitions.py) -10. Effects (effects.py) -11. Review (review.py) \ No newline at end of file diff --git a/intermediate/README.md b/intermediate/README.md new file mode 100644 index 0000000..74b3cd1 --- /dev/null +++ b/intermediate/README.md @@ -0,0 +1,10 @@ +#Cocos2D Python Intermediate Topics +---------------------------------- + +Here is the order which the tutorial follows: + +1. Tiled Maps Schema [mapmaking.tmx](mapmaking.tmx) +2. Applying Maps as Layers [maps.py](maps.py) +3. Adding Layers and Scrolling on Maps [add.py](add.py) +4. Adding Collision Detection to Maps [collision.py](collision.py) +5. Making Menus with Cocos [menu.py](menu.py) diff --git a/intermediate/intermediate.md b/intermediate/intermediate.md deleted file mode 100644 index d3f02b8..0000000 --- a/intermediate/intermediate.md +++ /dev/null @@ -1,10 +0,0 @@ -#Cocos2D Python Intermediate Topics ----------------------------------- - -Here is the order which the tutorial follows: - -1. Tiled Maps Schema (mapmaking.tmx) -2. Applying Maps as Layers (maps.py) -3. Adding Layers and Scrolling on Maps (add.py) -4. Adding Collision Detection to Maps (collision.py) -5. Making Menus with Cocos (menu.py) \ No newline at end of file From 30d6e0cbd683c1b153437e801550c4b37bf3f3c9 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Tue, 14 Mar 2017 10:40:28 +0100 Subject: [PATCH 2/4] Prettying the Markdown --- basics/README.md | 25 ++++++++++++------------- intermediate/README.md | 13 ++++++------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/basics/README.md b/basics/README.md index 6c347e4..1e58dd3 100644 --- a/basics/README.md +++ b/basics/README.md @@ -1,16 +1,15 @@ -#Cocos2D Python Basics ----------------------- +# Cocos2D Python Basics Here is the order which the tutorial follows: -1. Getting Started [start.py](start.py) -2. Adding Actors [actors.py](actors.py) -3. Basic Actions [actions.py](actions.py) -4. Keyboard Input [keyboard.py](keyboard.py) -5. Mouse Input [mouse.py](mouse.py) -6. Applying User Input [input.py](input.py) -7. Audio Playback [audio.py](audio.py) -8. Multiple Scene Games [scenes.py](scenes.py) -9. Transitioning Between Scenes [transition.py](transitions.py) -10. Effects [effects.py](effects.py) -11. Review [review.py](review.py) +1. [Getting Started](start.py) +2. [Adding Actors](actors.py) +3. [Basic Actions](actions.py) +4. [Keyboard Input](keyboard.py) +5. [Mouse Inputi](mouse.py) +6. [Applying User Input](input.py) +7. [Audio Playback](audio.py) +8. [Multiple Scene Games](scenes.py) +9. [Transitioning Between Scenes](transitions.py) +10. [Effects](effects.py) +11. [Review](review.py) diff --git a/intermediate/README.md b/intermediate/README.md index 74b3cd1..aca6dcf 100644 --- a/intermediate/README.md +++ b/intermediate/README.md @@ -1,10 +1,9 @@ -#Cocos2D Python Intermediate Topics ----------------------------------- +# Cocos2D Python Intermediate Topics Here is the order which the tutorial follows: -1. Tiled Maps Schema [mapmaking.tmx](mapmaking.tmx) -2. Applying Maps as Layers [maps.py](maps.py) -3. Adding Layers and Scrolling on Maps [add.py](add.py) -4. Adding Collision Detection to Maps [collision.py](collision.py) -5. Making Menus with Cocos [menu.py](menu.py) +1. [Tiled Maps Schema](mapmaking.tmx) +2. [Applying Maps as Layers](maps.py) +3. [Adding Layers and Scrolling on Maps](add.py) +4. [Adding Collision Detection to Maps](collision.py) +5. [Making Menus with Cocos](menu.py) From 5e0a4a393f17103fd9787c2c228b34bae5a6284d Mon Sep 17 00:00:00 2001 From: Liam Rahav Date: Tue, 14 Mar 2017 12:27:02 -0400 Subject: [PATCH 3/4] Update start.py --- basics/start.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basics/start.py b/basics/start.py index 47e240e..32ee864 100644 --- a/basics/start.py +++ b/basics/start.py @@ -1,4 +1,4 @@ -# I chose these import statements just to make my close look cleaner +# I chose these import statements just to make my code look cleaner # For this to work you would just need to import cocos and then add the subdirectory after # Ex: self.label = Label(...) would be self.label = cocos.text.Label(...) From 3a41106e6104ade71513e0b0d8589aba37250d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hor=C3=A1cio=20Dias?= Date: Wed, 5 Apr 2017 10:13:49 -0300 Subject: [PATCH 4/4] Updating sample colision for use new RectMapCollider from from cocos.mapcolliders and implements the new method on_bump_handler --- intermediate/collision.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/intermediate/collision.py b/intermediate/collision.py index d64c68e..22f1d55 100644 --- a/intermediate/collision.py +++ b/intermediate/collision.py @@ -1,6 +1,7 @@ # Import statements as usual from cocos.sprite import Sprite -from cocos.tiles import load, RectMapCollider +from cocos.tiles import load +from cocos.mapcolliders import RectMapCollider from cocos.layer import ScrollingManager, ScrollableLayer, ColorLayer from cocos.director import director from cocos.scene import Scene @@ -37,6 +38,8 @@ def start(self): # We also tell the game that our sprite is starting on the ground self.on_ground = True + def on_bump_handler(self, vx, vy): + return (vx, vy) # Now once again we update this "step" function def step(self, dt):