Thunderfist Posted April 30, 2018 Share Posted April 30, 2018 So, I've managed to make my character sprite move, but the collision doesn't work and the sprite can move out of bound even though I've defined the outOfBounds function. Is there anything I can do about this? And so you know, when this: if (!obstacleCollision) { this.drawX = newDrawX; this.drawY = newDrawY; } is changed to this: if (!obstacleCollision && !outOfBounds (this, newDrawX, newDrawY) { this.drawX = newDrawX; this.drawY = newDrawY; } The sprite is locked in place! I had to remove that part in order for the code to work. Quote Link to comment Share on other sites More sharing options...
Thunderfist Posted May 1, 2018 Author Share Posted May 1, 2018 So... I apparently didn't program the edges of my map to have collision data. Whoops. Anyways, I've got until the 18th of this month to finish this. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.