Skip to content

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

Open
horstjens wants to merge 1 commit intopvcraven:masterfrom
horstjens:patch-2
Open

Update step_5.py make program work directly from the book#22
horstjens wants to merge 1 commit intopvcraven:masterfrom
horstjens:patch-2

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

# 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.


# 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.

2 participants

Comments