I am trying to experiment with Jquery by writing a small game where i am using html div's as game character, so i have this div with id bullet attach to another div with id player, so i have bind on click action to body so that when user click any part of the page body the player fires the button and i am using the Jquery animate method to do that and it works fine except the bullet goes and remain at the top of the page, whereas i want a case where player can fire many bullets at the same time so how can i achieve this. I do not want my bullet div to go and stick at the top.
app.js file
//Control mouse movement and bullet movement
$(document).ready(function(){
$('body').mousemove(function(event){
var msg = 'Handler for mouse called at'
//moves bullet to current mouse position and player position
$('#bullet').css({'left':event.pageX})
//moves player to the current mouse postion
$('#player').css({'left':event.pageX})
})
})
//Fires bullet
$('body').click(function(){
$('#bullet').animate({'bottom':'500px'})
})