Skip to content

Conversation

@manuq
Copy link
Contributor

@manuq manuq commented Jun 19, 2024

  • Pong demo: Add area for spawning balls
  • Pong demo: Add areas for goals

https://phabricator.endlessm.com/T35504

manuq added 2 commits June 19, 2024 11:04
In Pong the balls spawn at a random position from the center vertical
line. To avoid the maths, one option is to pick a random point from an
Area2D with a thin vertical rectangle as collision shape. The area has
group "ball_spawn_area" so it can be referenced.
Add 2 Area2D nodes to main with the same rectangle shape, one for the
left goal and one for the right goal. Add groups so they can be
referenced from blocks.
Copy link
Member

@wjt wjt left a comment

Choose a reason for hiding this comment

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

OK

@wjt wjt merged commit a79ef8a into main Jun 19, 2024
@wjt wjt deleted the pong-areas branch June 19, 2024 14:25
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.

3 participants