Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update step_5.py make program work directly from the book #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

horstjens
Copy link
Contributor

several minor errors made the program not working when directly taken out of the book (step_5.py https://learn.arcade.academy/en/latest/chapters/25_sprites_and_walls/sprites_and_walls.html#using-a-camera-for-scrolling)

  • resources paths were not correct anymore (i guess it dated from a previous version where resources were not organized in subfolders )

  • method move_camera_to_player was called but actually did not existed

several minor errors made the program not working when directly taken out of the book (step_5.py
https://learn.arcade.academy/en/latest/chapters/25_sprites_and_walls/sprites_and_walls.html#using-a-camera-for-scrolling)

* resources paths were not correct anymore (i guess it dated from a previous version where resources were not organized in subfolders )

* method  move_camera_to_player was called but actually did not existed
@@ -48,28 +48,28 @@ def setup(self):
self.score = 0

# Create the player
self.player_sprite = arcade.Sprite("images/character.png", SPRITE_SCALING_PLAYER)
self.player_sprite = arcade.Sprite(":resources:images/animated_characters/female_adventurer/femaleAdventurer_idle.png", SPRITE_SCALING_PLAYER)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea for this example was to get students to practice downloading and using their own images, rather than the build-in resources.

@@ -113,14 +113,14 @@ def on_update(self, delta_time):
self.physics_engine.update()

# Scroll the screen to the player
self.scroll_to_player()
#self.scroll_to_player()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this is missing. The linked example from the API has the definition.

With the new 3.0, if it ever gets released, has a reworked camera that will change this section again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there something I can do to help you with version 3.0 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants