User Tag List

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

Thread: "Shoot an object" problem & another question

  1. #1
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)

    Join Date
    Sep 2007
    Location
    Austria
    Posts
    289
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    "Shoot an object" problem & another question

    Hi!

    1) My character collects an item. A variable is set to 1. He can shoot...the shot does not have collision detection. It flies through walls. I cannot apply collision detection that's why I use another method:

    player presses fire -> set shot-object to 0/0 of player, set dir to dir of player etc.

    The shot-object is positioned outside the playfield. It works but when I want to shoot again while shot #1 is still flying the first shot starts again at 0/0 of my character. I tried a solution with "player presses fire -> create shot-object" etc. but still the same problem...

    How can I have multiple shots that can bounce off walls?

    2) Apples, bananas, lemons all belong to my group 1.
    If I collide with them they disappear (one of them).

    When I get an apple, I should get 5 points...20 for a banana...how can I use groups in this case?

    If character collides with group 1 => add x to points...but the cpu does not know which fruit I have just collected.

    3) A similar question:

    Players 1, 2, 3 and 4 all belong to my group "players".
    Player 1 is controlled by joypad1, 2 by joypad 2 etc.

    If player 1 collides with... he loses one life. "Subtract 1 from joypad1"...

    Again, can I use groups? If one member of group "players" collides with... subtract one of ... does not work as the cpu does not know who is who.

    Is there another solution apart from coding such events manually for player 1 AND player 2 AND player 3 etc.?

  2. #2
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)

    Join Date
    Sep 2007
    Location
    Austria
    Posts
    289
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: "Shoot an object" problem & another question

    Anyone?

  3. #3
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: "Shoot an object" problem & another question

    2: Set up an alterable value in all the objects in the frame editor saying how many points they're worth. Then in events editor, do:
    Player has collided with group.group1:
    -Player: Add Alterable Value A("group.group1") to score
    -Destroy group.group1

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: "Shoot an object" problem & another question

    For Question 1:

    I'm not totally sure of what you are doing from your description, but there are a couple ways you could do this. The easiest way using your existing approach is to make sure the bullet object is set to Bouncing Ball movement. This will give it a speed when the you "fire" it and also allows it to bounce when it hits something. So your code could look like this:

    Player presses Spacebar
    ->Create Bullet at 0,0 of(Player)
    ->Set Bullet Direction to Dir (Player) [Note: this is under Animation -> Animation Direction in the Actions dropdown]

    Then you need some collision events to make the bullet bounce:

    Bullet collides with (object)
    ->Bounce [in the bullet column]

    If you want the bouncing to be more predictable, you would have to probably use the Clickteam Movement Controller object and set the speed and direction manually using expressions. but that is a bit more complex.

    Hope that helps you get started,

    Mobichan

  5. #5
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)

    Join Date
    Sep 2007
    Location
    Austria
    Posts
    289
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: "Shoot an object" problem & another question

    Thanks but this does not work. If I shoot a bouncing ball it does not bounce anymore because of the event "shoot an object".

  6. #6
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,825
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Re: "Shoot an object" problem & another question

    If you want control of the object you can't use the shoot an object action.

    You would have to create a regular object set its direction and movement and then you can get some control over it.

  7. #7
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)

    Join Date
    Sep 2007
    Location
    Austria
    Posts
    289
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: "Shoot an object" problem & another question

    But this means that I have to create bouncing ball 1, bouncing ball 2, bouncing ball 3 and bouncing ball 4 if a player has up to four bouncing shots in a level at the same time?

    If two players fight and each of them can shoot up to four bouncing balls it will need many events. If player shoots and bouncing ball 1 is already flying and bouncing ball 2 is already flying then shoot bouncing ball 3 etc.

  8. #8
    No Products Registered

    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    1,141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: "Shoot an object" problem & another question

    Use the create object event instead of shoot an object and you won't need multiple objects.

  9. #9
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: "Shoot an object" problem & another question

    My code works because I tested it before posting. And it is only 2 lines of code. If you want to limit the number of shots per player, that needs additional code to stop the player from firing unlimited bullets. As Jeff said, you can't use "Shoot an object" in this case. Well, maybe it is possible, but it would get messy.

    Basically, this code approach spawns a bullet in your game at the position of the player and then it becomes an independant entity with its own behavior. Every time you spawn a new bullet entity, it will act on its own.

    Mobichan

  10. #10
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)

    Join Date
    Sep 2007
    Location
    Austria
    Posts
    289
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: "Shoot an object" problem & another question

    Mobichan I cannot get it to work.

    I can shoot the bouncing ball but when I shoot again the same shot is used again...it starts again at 0/0 of the player. It does not launch a new ball.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. "Load text file" from "The Edit Object" BUG?
    By MOBii in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 19th December 2013, 05:43 AM
  2. "Caret" problems with the Rich Edit Object/Fast Loop Question
    By Gullyking in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 4th June 2012, 04:41 AM
  3. Issues with "Clickteam Movement Controller" and "Runtime" Object
    By jimmyorpheus in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 29th November 2011, 07:10 AM
  4. What Happenned to the "shoot object" option!!!???
    By Jacob_Miller in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 31st October 2010, 06:06 PM
  5. Tower Defence "Shoot Closest Enemy" Example
    By netninja in forum File Archive
    Replies: 5
    Last Post: 28th October 2009, 01:33 AM

Posting Permissions

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