Closed ROODAY closed 10 years ago
Translate the context to the center of the player using gctx.translate(x,y). Two things to watch out for:
I've done some of that in the turret code, which will be pushed soon...
Tried that, still won't work. Can you take a look? I may have messed up somewhere and not noticed it
.....ok nvm. right now the arrow keys for the turret move it in the cardinal directions only, the rotation (which follows the mouse) is completely independent. We'll have to consider if we want to implement the mouse-following movement (b/c after all, it's a turret and should be able to shoot in any direction regardless of which way it's moving)
Yeah I agree, the turret should be able to shoot anywhere. The movement is just for getting away from enemies. So stick with independent mouse?
Yes, i think we should stick with that at least for now.
wait I think we got off topic. The main issue is still there, at least in gh-pages. The context isn't translating to the player.
sorry, my bad.
It seems like you're doing the same as what I'm doing in the Turret class- i'll look closer.
(for reference, turret class is at https://github.com/WWPOL/Earth-Invader/blob/turret/js/turret.js)
Phil please help