diff --git a/basics/README.md b/basics/README.md new file mode 100644 index 0000000..1e58dd3 --- /dev/null +++ b/basics/README.md @@ -0,0 +1,15 @@ +# 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 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/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/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(...) diff --git a/intermediate/README.md b/intermediate/README.md new file mode 100644 index 0000000..aca6dcf --- /dev/null +++ b/intermediate/README.md @@ -0,0 +1,9 @@ +# 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) 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): 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