Skip to content

Commit a3fc633

Browse files
mrElnekavetinmarrtsedan
authored
Final workshop prep (#413)
* clean up * strip for me daddy * clean up * remove controller from stripped * cleanup * step 1 * step 2 done * Update step2.rst * added step 3 support * added step 3b * clean up w/ martin * quick fix * updated for step 3b * step 4 done. * step 5 ready * clean up and doing the tutorial myself. * Update index_img.png * delete tutorial follow along files. * file update * I want to get notified when u are PRing for .py * revision and edits * googify * habibi * okay * step1-3 * step4 gooder * emphAsis * gog rst * steps one through three done! * omg its done * step four googify * step 5 googify * remove custom components demo/tutorial * final changes * rename test folder * oops Co-authored-by: Martin Chaperot <martin.chapino@gmail.com> Co-authored-by: Tomer Sedan <tomer.sedan@pm.me>
1 parent ac9e390 commit a3fc633

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1118
-1124
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
* @tsedan @tinmarr
2+
*.py @mrElnekave

.vscode/settings.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,7 @@
4343
"python.formatting.provider": "yapf",
4444
"python.linting.pylintCategorySeverity.refactor": "Information",
4545
"githubPullRequests.ignoredPrBranches": ["main"],
46-
"python.linting.ignorePatterns": [
47-
"**/site-packages/**/*.py",
48-
".vscode/*.py",
49-
"demo/**/*",
50-
"docs/**/*"
51-
],
46+
"python.linting.ignorePatterns": ["**/site-packages/**/*.py", ".vscode/*.py", "demo/**/*", "docs/**/*"],
5247
"githubPullRequests.ignoredPullRequestBranches": ["main"],
5348
"files.associations": {
5449
"cstdint": "c",

b

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ doc() {
9696
./b del -b
9797
./b doc -c
9898
cd docs
99-
sphinx-autobuild "$SOURCEDIR" "$BUILDDIR" -b $BUILDER $O --watch ../rubato
99+
sphinx-autobuild "$SOURCEDIR" "$BUILDDIR" -b $BUILDER $O --watch ../
100100
cd ..
101101
if [[ -d build ]]
102102
then

demo/custom_components.py

Lines changed: 0 additions & 77 deletions
This file was deleted.

demo/platformer/data_scene.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

demo/platformer/files.zip

772 KB
Binary file not shown.

demo/platformer/level1.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
from rubato import Scene, Color, Display, GameObject, Vector, Rectangle, wrap, Font, Text, Radio, Events, Game, Time
22
import shared
3-
from data_scene import DataScene
43

5-
scene = DataScene("level1", background_color=shared.background_color)
4+
scene = shared.DataScene("level1", background_color=shared.background_color)
65
scene.level_size = int(Display.res.x * 1.2)
76

87
end_location = Vector(Display.left + scene.level_size - 128, 450)

demo/platformer/level2.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
from rubato import Display, Vector, Color, Rectangle, wrap, GameObject, Radio, Events, Game, Raster
2-
from data_scene import DataScene
32
from moving_platform import MovingPlatform
43
import shared
54

6-
scene = DataScene("level2", background_color=shared.background_color)
5+
scene = shared.DataScene("level2", background_color=shared.background_color)
76
scene.level_size = int(Display.res.x * 2)
87

98
end_location = Vector(Display.left + scene.level_size - 128, 0)

demo/platformer/player_controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from rubato import Component, Animation, RigidBody, Rectangle, Manifold, Radio, Events, KeyResponse, JoyButtonResponse \
22
, Input, Math, Display, Game, Time, Vector
3-
from data_scene import DataScene
3+
from shared import DataScene
44

55

66
class PlayerController(Component):

demo/platformer/shared.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
import rubato as rb
2-
from data_scene import DataScene
3-
from player_controller import PlayerController
42
from random import randint
53

4+
5+
##### DATA SCENE #####
6+
class DataScene(rb.Scene):
7+
8+
def __init__(self, *args, **kwargs):
9+
super().__init__(*args, **kwargs)
10+
self.level_size = 0
11+
12+
13+
from player_controller import PlayerController
14+
15+
##### MISC #####
16+
617
black_32 = rb.Font(size=32)
718
white_32 = rb.Font(size=32, color=rb.Color.white)
819
start_time = 0
@@ -57,9 +68,9 @@ def update(self):
5768
player_comp := PlayerController(),
5869
)
5970

60-
##### PORTAL #####
71+
##### Flag #####
6172

62-
# Create animation for portal
73+
# Create animation for flag
6374
flag_sheet = rb.Spritesheet(
6475
path="files/flag.png",
6576
sprite_size=rb.Vector(32, 32),
@@ -69,14 +80,14 @@ def update(self):
6980
flag_animation = rb.Animation(scale=rb.Vector(4, 4), fps=6, flipx=True)
7081
flag_animation.add_spritesheet("", flag_sheet, to_coord=flag_sheet.end)
7182

72-
# create the end portal
83+
# create the end flag
7384
flag = rb.GameObject()
7485
flag.add(flag_animation)
7586

7687
flag.add(
7788
rb.Rectangle(
7889
trigger=True,
79-
tag="portal",
90+
tag="flag",
8091
width=-flag_animation.anim_frame().size_scaled().x,
8192
height=flag_animation.anim_frame().size_scaled().y,
8293
)

0 commit comments

Comments
 (0)