Noob question about rotating images
Hello all,
I've just started to use jQuery and im totally lost. Im not familiar with jQuery syntax and now i need it to rotate image. Basicly i just dont get what i suppose to write inside $('#HERE'). Its in line 18 and im trying to rotate that heroImage (hero.png) there. $('heroImage') wont work. $(heroImage) wont work.... what i suppose to write there to rotate image? pls help the noob :)
- // Hero image
- var heroReady = false;
- var heroImage = new Image();
- heroImage.onload = function () {
- heroReady = true;
- };
- heroImage.src = "hero.png";
- // Update game objects
- var update = function (modifier) {
- if (38 in keysDown) { // Player holding up
- if(board[Math.round(hero.y/32-0.5)][Math.round((hero.x+3)/32-0.5)] == 0 && board[Math.round(hero.y/32-0.5)][Math.round((hero.x-3)/32+0.5)] == 0){
- hero.y -= hero.speed * modifier;
- $('#HERE').rotate(45);
- }else{}
- }
- ....and code continues....