Collisions and movement - Spellwizard/PortfolioBuilder GitHub Wiki

use arraylist [pixel width] [pixel length] gridBoard to track all positions of all objects

Listen for a GAMESPEED lapse in time for a projectile then attempt to update it's movement Listen for player's keyboard input

Collision check movement update function outline Anytime object moves check coords if = to a 0 position or the pixel limit if projectile: delete the projectile if player / other types of moving stuff: stop movement off screen check the updated position of item against all other objects for collisions if projectile hits player : else if player hits wall: prevent movement into wall by not updating player position to match wall

only if all safety parameters have been met can the projectile position be updated the player position updated other moving object updated