User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 15 of 15

Thread: Collisions use to work what did I do

  1. #11
    Clicker Fusion 2.5

    Join Date
    Aug 2014
    Location
    Hawaii
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahhh... I see. I already had the destroy on the loop "remove target", and the condition for going to that loop was met when one of the missiles was within 3 pixels of the aim point... So in essence, I was destroying the aim point on line 30, then it went to remove target function (line 32), where it was removing the aimpoint and missile, causing the unwanted behavior. Sweet, I think I'm understanding the loops better, I'll keep implementing them whenever I see repetitive calls, thanks for the tip.

    I see what you are saying on the cpu usage and complexity, so thanks for that additional explanation. Here is why I thought it was about the same, food for thought. So see what you think (for collisions)

    --Collision Detection method (my original way)
    Frame 1
    ...
    CPU tests for all missile / aim point collisions (i.e. 10 missiles 10 aim points)
    ...

    Frame 2
    ...
    CPU tests for all missile / aim point collisions (i.e. 20 missiles 20 aim points)
    ...


    ---Missile Range Detection method (your cooler / cpu saving way)
    Frame 1
    ...
    CPU creates objDistance variable, stores initial distance from aim point in variable
    CPU re-calculates missile range variable objDistance in pixels as it moves
    CPU test all missiles where objDistance <= 3 (i.e. 4 missiles 4 aim points)
    ...

    Frame 2
    ...
    CPU creates objDistance variable, stores initial distance from aim point in variable
    CPU re-calculates missile range variable objDistance in pixels as it moves
    CPU test all missiles where objDistance <= 3 (i.e. 8 missiles 8 aim points)
    ...


    That's what I thought about in my head when I say its more complex lol. To me the second way IS using less CPU, but more complex in coding / debugging... at least it was to me at first I mean, I get it now, and it makes sense, I just never thought of it like that. It seemed simpler to just say "hey if any collisions occur", rather than "create a variable to track distance between the objects", "recalculate that distance every frame", "destroy objects when distance <=3". I like cool stuff like that though, where you basically make your own "collision detection" method and are able to squeeze out more CPU power!!

    So thanks a bunch bro for the explanations! You've definitely given me ALOT more tools / methods to code my games more efficiently!

  2. #12
    Clicker Fusion 2.5
    Bertard's Avatar
    Join Date
    Jan 2014
    Posts
    150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Snail i have a crazy question :

    Why Set X pos to Xmouse +0.0 and not Xmouse alone ??

  3. #13
    Clicker Fusion 2.5

    Join Date
    Aug 2014
    Location
    Hawaii
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I saw that too...I'm going to take a guess and say it makes the integer convert to a float....drumroll...Snail says? lol

  4. #14
    Clicker Fusion 2.5

    Join Date
    Aug 2014
    Location
    Hawaii
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    YESSS!!! I actually have proof I'm learning something, whooohooooo!

    Yeah, I see what you mean, that would work too. I think I might not stick with this now, lol

    Last question for me. Would it benefit any to multiply by 1.00000 to convert it to 12.00000 for an (insane) amount of detail in the angle?

  5. #15
    Clicker Fusion 2.5

    Join Date
    Aug 2014
    Location
    Hawaii
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    VERY cool to know, I'll stay with this method then for sure!!

    Thanks again Snail, you the man! er..snail, lol

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Collisions with Platform Movement doesn't work
    By Zugwang in forum Fusion 2.5
    Replies: 6
    Last Post: 27th June 2015, 05:17 PM
  2. Collisions with 247
    By LB in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 27th April 2008, 01:52 AM
  3. Collisions.
    By Conno in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 22nd November 2006, 06:02 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
  •