I was looking at the flow example, and it inspired me to go ahead and write some custom draw functions for my sprites. Just for fun, I want to see if I can create some interesting visual effects in this way.
I have a problem at the moment, and I can't understand why. It's a long story, but I've managed to reduce the problem to this: if I draw the borders of a simple rectangle (which is as big as the size of my sprite), then when I move my sprite, I get some visual problems. It's as if it didn't erase the borders from the previous position, it just draws the sprite at the new position, on top of the old one.
But if I use the draw function that comes with wade (wade.drawFunctions.drawRect_), it does the same thing but works perfectly! I can't understand why mine doesn't work... here's my code, if you can help with this it would great!
var position = this.getPosition();var size = this.getSize();context.strokeColor = 'red';context.strokeRect(position.x - size.x / 2, position.y - size.y / 2, size.x, size.y);context.stroke();