Skip navigation
Mattielolo
Currently Being Moderated

Help with rhythm game

Jun 26, 2012 4:44 AM

So i am starting university in late september (to learn 3d character animation) and need to get the grades to get in, sadly we have a flash programming unit in the college course im in now and we didnt get taught anything at all and i mean nothing, we were given printed sheets and told to copy the code word for word. so i really need help with my game. how would i make the movement of something my cursor? so when i move the cursor it follows it? also how do i play an animation on click?

My  idea for the game is to have a rhythm style game where the player moves the net and catches the bee's, something i thought would be simple to figure out how to do

 

This is my game at the minute, ive used the code we were told to copy from sheets and just changed the sprites :\ any help would be amazing!
https://www.dropbox.com/s/1pjbv2mavycsi3q/sopaceship%20rev7%20%20movin g%20bullet.fla

 
Replies
  • Currently Being Moderated
    Jun 26, 2012 4:58 AM   in reply to Mattielolo

    You should search Google for a tutorial.  Try using search terms like "AS3 custom cursor tutorial"  THat should help you with having something following the cursor.  As far as clicking something to make something happen, I would bet even the printed sheets you were given will have enough information for you to work out such a basic functionality.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 28, 2012 1:55 PM   in reply to Mattielolo

    http://orangesplotch.com/blog/flash-tutorial-elastic-object-follower/

     

    var distx:Number;

    var disty:Number;

    var momentumx:Number;

    var momentumy:Number;

     

    follower.addEventListener(Event.ENTER_FRAME, FollowMouse)

    function FollowMouse(event:Event):void {

         // follow the mouse in a more elastic way

         // by using momentum

         distx = follower.x - mouseX;

         disty = follower.y - mouseY;

         momentumx -= distx / 3;

         momentumy -= disty / 3;

     

         // dampen the momentum a little

         momentumx *= 0.75;

         momentumy *= 0.75;

     

         // go get that mouse!

         follower.x += momentumx;

         follower.y += momentumy;

    }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points