User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: Chasing Cars

  1. #1
    No Products Registered

    Join Date
    Jul 2007
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Chasing Cars

    I am trying to build a game where the player's car is chased by computer controlled cars.

    The only way I have managed to do this so far is to set the computer cars with bouncing ball movement and then set an event which runs every tenth of a second which sets the computer controlled car to look in the direction of the player.

    This method works ok but the problem is that the computer cars 'jump' to the new direction rather than rotate through all the directions until reaching its final destination.

    Does anybody have a solution to this problem?

    oh and by the way, has the step-through editor dissapeared from TGF2?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Jun 2007
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Chasing Cars

    Not sure if this is gonna work for ya, but it worked for me a time ago.

    ALWAYS: Look on the player
    AND
    Emeny car: "Set postion" X 00, Y 30 from the emeny car itself. And remember to set it to " in direction of emeny car"
    under <located> in the options-

    See if that works.

  3. #3
    No Products Registered

    Join Date
    Jul 2007
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Chasing Cars

    Thanks but unfortunately that just seems to send the enemy in a straight line and into oblivion

  4. #4
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Chasing Cars

    use thae bouncing ball movemnet and
    ALWAYS
    look in direction 0,0 player

  5. #5
    No Products Registered

    Join Date
    Jul 2007
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Chasing Cars

    This unfortunately still doesn't work as when the player passes the enemy, he suddenly jumps 180 degrees!

    I gather this is possible with MMF + Advanced movement object extension but unfortunately the demo version of multimedia fusion does not support the installation of extensions so if I want to test this theory I'm going to have to fork out the cash and hope it works. Ouch!

  6. #6
    No Products Registered

    Join Date
    Jan 2007
    Location
    NC - USA
    Posts
    261
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Chasing Cars

    There are methods to do it in TGF, but it requires a little bit of math. Lucky for us, the hardest parts are already done with the Clickteam movement controller

    For starters you could code something similar to (Assuming you are using direction and not angles):

    - Dir("Enemy car") < Anglepoint("Clickteam Movement Controller", Xpos("Enemy car"), Ypos("Enemy car"), Xpos("Player car"), Ypos("Player car"))/11.25
    -> Set direction of ("Enemy car") to dir("Enemy car") + 1

    - Dir("Enemy car") > Anglepoint("Clickteam Movement Controller", Xpos("Enemy car"), Ypos("Enemy car"), Xpos("Player car"), Ypos("Player car"))/11.25
    -> Set direction of ("Enemy car") to dir("Enemy car") - 1

    That very simply will make it where if its not pointed towards the player it will move there gradually. (You can replace 1 with a higher number to make it turn faster.)

    You will notice that the cars wont turn across the 32/0 direction and if something is in this direction will do a odd sort of fishtail. I have a fully working engine that eliminates all this and uses angles too, but i wont be able to get to it untill friday...

    Hope this helped somehow.

  7. #7
    No Products Registered

    Join Date
    Jul 2007
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Chasing Cars

    Hmm thanks for that. I'll give it a try when I get a chance. I think I'm going to have to read up on the clickteam movement controller first though.


    Presuming that works, the crossover should be simply a case of adding an "+Dir("Enemy Car") = 32" to the first (then set direction to 0) and "+Dir("Enemy Car") = 32" to the second (then set to 32), right?

  8. #8
    No Products Registered

    Join Date
    Jan 2007
    Location
    NC - USA
    Posts
    261
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Chasing Cars

    Not neccesarily. Its slightly more complicated than that.
    It will crossover without a fix, provided that the object its chasing goes from its 32/0 angle to its first or reverse by only one direction.

    To truly do this accurately, we need to know if it can turn to the desired direction faster by turning left, or by turning right. This sounds simple, but in implementation plays out to be a little more complicated than it seems.

    The easiest way for you to see what i mean would be to give it a try and see what happens.

  9. #9
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Chasing Cars

    It's intended for MMF, so I dunno if it's possible to work around it without using extensions, but this may help:

    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=66421#Post66421

  10. #10
    No Products Registered

    Join Date
    Jul 2007
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Chasing Cars

    stArill

    I'm afraid I'm stumbling at the first block!

    When I try and create an action for Enemy Car's direction it only allows me to test if the direction is EQUAL to a value, not less than.

    btw sorry it's taken so long to get around to testing this, I've been very busy lately and not had a chance to get to game creating

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Driving Cars problems
    By Tiles in forum File Archive
    Replies: 5
    Last Post: 7th November 2010, 08:13 AM
  2. A Chasing enemy
    By Lillmissthang in forum Multimedia Fusion 2 - Technical Support
    Replies: 17
    Last Post: 1st March 2010, 02:01 PM
  3. Racing cars
    By Robin_Manager in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 10th July 2008, 06:27 AM
  4. Making cars act more like cars...
    By GameDesigner in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 2nd March 2007, 11:59 PM

Posting Permissions

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