CSCI 1106 Player Movement

Restriceons on movement may be needed eg disallowing

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: pears where the mouse is poinEng to –  No need to control the velocity of the avatar –  PosiEon and velocity is managed by the mouse movement •  How: –  Set the player sprite’s coordinates to the mouse coordinates at each FRAME event Direct Mouse Movement •  Pros: –  Easy –  Not much code required •  Cons: –  RestricEons on movement may be needed, e.g., •  Disallowing movement in some dimensions (paddle) •  Checking if mouse is over the game panel area –  Violates most accepted laws of physics •  Avatar can accelerate and move instantly •  How can we solve these problems? Mouse Movement using Easing •  Idea: gradually move avatar toward the locaEon clicked on with the mouse pointer –  –  –  ...
View Full Document

This document was uploaded on 03/27/2014 for the course CSCI 1106 at Dalhousie.

Ask a homework question - tutors are online