User Tools

Site Tools


notes:comporg:fall2023:projects:magx

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:comporg:fall2023:projects:magx [2023/11/15 18:01] – [Player Physics and Animations] walleynotes:comporg:fall2023:projects:magx [2023/11/15 18:07] (current) – [Player Physics and Animations] walley
Line 50: Line 50:
   - Position X   - Position X
   - Position Y   - Position Y
-Again, the Position data will be updated relative to the Obstacle X reference point.+Again, the Position data will be updated relative to the Obstacle X reference point. Additionally, a size variable will be kept in the stack so that we know how many elements reside within each obstacle pattern.
  
 +===Obstacle Collision and Rendering===
 +The processes for both collision checks and rendering are relatively the same. First, we check the Obstacle flag to see which pattern is currently spawned, and then grab the size variable associated with it. Secondly, we use that size variable to for-loop through each element in the obstacle to then either run collision checks on it, or render it.
  
 +For Collision, we check if the element is either a Block or a Spike using the Object Type variable. If it's a block, we run checks to see if the Player is on top of it, so that the Player can run and jump along it, or if the Player is in it to trigger a game over. For Spikes, there are two boxes inside it that if the player enters 
 +also triggers a game over.
  
 +For Rendering, the Object Type check is the same to select the right texture region, which gets printed at that position. Relatively simple.
  
notes/comporg/fall2023/projects/magx.1700071304.txt.gz · Last modified: 2023/11/15 18:01 by walley