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

Projectiles fail to spawn from the player when there's a wall at the top or bottom of the screen. #1104

Open
dannytech opened this issue Jun 27, 2019 · 0 comments

Comments

@dannytech
Copy link

commented Jun 27, 2019

Describe the bug
When a partial or complete wall is present at the top or bottom of the map, projectiles will fail to spawn if their initial velocity moves them away from the wall. Projectiles can be stopped from spawning completely by placing complete walls at the top and bottom of the map.

To Reproduce
Steps to reproduce the behavior:

  1. In a new project, create a player sprite that can be moved with buttons. The size and shape of the sprite do not matter.
  2. Set up a complete or partial wall on the top of the map, and/or a complete or partial wall on the bottom of the map.
  3. Using the generate projectile from sprite block, generate projectiles of any size and shape from the player sprite.
  4. Set the velocity of the projectiles to either of the following:
  • Math.sin(game.runtime() / 1000) * 50 for the vx and Math.cos(game.runtime() / 1000) * 50) for the vy
  • 0 for the vx and -100 or 100 for the vy

Test cases

  1. No walls/walls off
    nowalls

  2. A complete wall at the top
    fullwallattop

  3. A complete wall at the bottom
    fullwallatbottom

  4. A partial wall at the top
    partialwallattop

  5. A partial wall at the bottom
    partialwallatbottom

  6. Complete walls at the top and bottom
    fullwallsattopandbottom

  7. Partial walls at the top and bottom
    partialwallsattopandbottom

  8. vx of 0 and vy of -100 and complete wall on bottom
    completewallsgoingup

  9. vx of 0 and vy of -100 and partial wall on bottom
    partialwallsgoingup

  10. vx of 0 and vy of 100 and complete wall on top
    completewallsgoingdown

  11. vx of 0 and vy of 100 and partial wall on top
    partialwallsgoingdown

Expected behavior
Projectiles should spawn in any direction regardless of whether any walls are in the level or not.

Desktop (please complete the following information):

  • OS: Windows 10 OS Version 1903 (Build 18362.175)
  • Browser: Chrome 75.0.3770.100
  • Version: Arcade 0.12.17, MakeCode 5.17.29

Example project for repro
arcade-ProjectileSpawnRepro

Additional context
In the last 4 images, when the projectile is moving directly up or down (vx = 0), it spawns without issue when the sprite is at exactly the horizontal center of the map, but moving anywhere else stops them from spawning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.