Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2007
    Posts
    154
    Thanks
    52
    Thanked 0 Times in 0 Posts

    Netscape Please Please Help - REWARD

    Hey. Im having no luck whatsoever in creating a snooker game in Director. I have created all the images for tables etc and began to code the script.

    The game is basically a one ball snooker game with the aim of potting the ball in any pocket. I have two sprites (ball and cue).

    The game runs like this.

    The user moves the mouse which rotates the cue around the ball - DONE
    The user clicks the mouse to set the cue in place - DONE
    The user presses SPACE BAR and the ball travels in the direction the cue is facing towards. - THIS IS WHERE I AM HAVING PROBLEMS

    so far my code looks like this:

    Code:
    function exitframe(me) {
    
    
    _global.angle1 = Math.atan((_mouse.mouseV-sprite("cue").locV  )/(_mouse.mouseH-sprite("cue").locH  ))
    
    if (_mouse.mouseH < sprite("cue").locH) {
      sprite("cue").rotation = _global.angle1*180/Math.PI -90
    }
    else {
      sprite("cue").rotation = _global.angle1*180/Math.PI +90
    }
    
    }
    function beginsprite(me) {
    cuelock = 0
    }
    
    
    function exitframe(me) {
    
    if (cuelock == 0) {
    _global.angle1 = Math.atan((_mouse.mouseV-sprite("cue").locV  )/(_mouse.mouseH-sprite("cue").locH  ))
    if (_mouse.mouseH < sprite("cue").locH) {
      sprite("cue").rotation = _global.angle1*180/Math.PI -90
    }
    else {
      sprite("cue").rotation = _global.angle1*180/Math.PI +90
    }
    }
    if ((cuelock == 1) && (_key.keyPressed(49)) && (_mouse.mouseH < sprite("cue").locH)) {
      
      
      sprite(2).loch = _global.angle1*180/Math.PI +90
      sprite(2).locv = _global.angle1*180/Math.PI +90
      }
    else { 
    
      sprite(2).loch = _global.angle1*180/Math.PI -90
      sprite(2).locv = _global.angle1*180/Math.PI -90
    
      
    }
    }
    
    function mouseup(me) {
    cuelock = 1
    }
    
    
    function rightmouseup(me) {
    cuelock = 0
    }
    Can anyone help me finish this off asap as its driving me crazy...seriously i wake up in the night with visions of pool tables and angles and maths....

    Im willing to negotiate a reward for anyone who can help me complete this game. It needs to be in Javascript for Director MX04 as that is the software im comfortable using.

    Thanks

    Tom

  • #2
    Regular Coder
    Join Date
    Jan 2007
    Posts
    154
    Thanks
    52
    Thanked 0 Times in 0 Posts

    Exclamation

    I've updated the code. Ive got the ball moving now, just not to the correct location. Can someone please help...CASH REWARD ! ! !
    Code:
    function exitframe(me) {
    
    
    _global.angle1 = Math.atan((_mouse.mouseV-sprite("cue").locV  )/(_mouse.mouseH-sprite("cue").locH  ))
    
    if (_mouse.mouseH < sprite("cue").locH) {
      sprite("cue").rotation = _global.angle1*180/Math.PI -90
    }
    else {
      sprite("cue").rotation = _global.angle1*180/Math.PI +90
    }
    
    }
    function beginsprite(me) {
    cuelock = 0
    }
    
    
    function exitframe(me) {
    
    if (cuelock == 0) {
    _global.angle1 = Math.atan((_mouse.mouseV-sprite("cue").locV  )/(_mouse.mouseH-sprite("cue").locH  ))
    if (_mouse.mouseH < sprite("cue").locH) {
      sprite("cue").rotation = _global.angle1*180/Math.PI -90
    }
    else {
      sprite("cue").rotation = _global.angle1*180/Math.PI +90
    }
    }
    if ((cuelock == 1) && (_key.keyPressed(49))) {
       
      
      speed = 1
    
      sprite(2).loch = Math.cos(_global.angle1*180/Math.PI -90)*speed
      sprite(2).locv = Math.sin(_global.angle1*180/Math.PI -90)*speed
      
    }
      
     
     } 
    
    
    function mouseup(me) {
    cuelock = 1
    }
    
    
    function rightmouseup(me) {
    cuelock = 0
    }

  • #3
    Regular Coder
    Join Date
    Jan 2007
    Posts
    154
    Thanks
    52
    Thanked 0 Times in 0 Posts
    Just an update. I offering a CASH reward....please help me..


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •