User Tag List

Results 1 to 10 of 10

Thread: sniper rifle / beam collision

  1. #1
    No Products Registered

    Join Date
    Dec 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sniper rifle / beam collision

    I am looking to make a kind of sniper rifle which should work as follows.
    Originates from the player.
    Makes a visible beam/straight line.
    Beam collides with either the background or an enemy.

    After a fair bit of tinkering, I haven't even come up with a bad solution - let alone one that really works. :/

    I have the feeling maybe the overlay redux extension is the answer to my problems, but I have no idea how to use it, even after looking at an example.
    I've not found any tutorials on how to use it either...

  2. #2
    No Products Registered

    Join Date
    Jan 2009
    Location
    Usa
    Posts
    190
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sniper rifle / beam collision

    wat is the problem?

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Jaffob's Avatar
    Join Date
    May 2008
    Location
    USA
    Posts
    1,833
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sniper rifle / beam collision

    A long time ago I posted a beam/laser example. It only goes horizontally and vertically, though.

    Link

  4. #4
    No Products Registered

    Join Date
    Feb 2009
    Location
    CA, USA
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sniper rifle / beam collision

    Aww. I spent about 5 minutes making this example just so Jaffob could beat me. Anyways, here it is. Very simple.http://theclickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=128519&#Post128 519

  5. #5
    No Products Registered

    Join Date
    Dec 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sniper rifle / beam collision

    Thanks!

    The example by DMT crashes for me.

    I am currently trying Jaffob's example
    I have to change my background objects to active objects though as I see that the backgrounds on Jaffob's examples are active objects.

    A bit of a general question but: Why would I want to make an object a "background object"?
    What are the benefits? Why not make it an active object instead and have the benefits of more options such as being able to assign it to a group for eg.

  6. #6
    No Products Registered

    Join Date
    Dec 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sniper rifle / beam collision

    I have tried Jaffob's laser tutorial and it seems to be pretty much the effect I want to achieve.

    I haven't managed to get it to work in my game 'though. Here is how I have it:

    One of the reasons is because I don't understand a few fundamental things about this extension.

    - Why am I covering the entire background of my game with the overlay object?

    - What does the 'clear' command do?

  7. #7
    No Products Registered

    Join Date
    Aug 2006
    Posts
    984
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sniper rifle / beam collision

    Quote Originally Posted by dub
    One of the reasons is because I don't understand a few fundamental things about this extension.

    - Why am I covering the entire background of my game with the overlay object?

    - What does the 'clear' command do?
    1. overlay can only draw to its own surface, so you have to cover at least the entire screen to be able to draw the beam wherever (actually, you only need to cover what the beam needs to draw to, but doing it that way requires a fair bit of resizing and repositioning the overlay)

    2. 'clear' just erases what's been drawn to the overlay; if you don't do this, your beam will pretty much "smear" all over the screen

  8. #8
    No Products Registered

    Join Date
    Dec 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sniper rifle / beam collision

    Quote Originally Posted by xyzzy
    1. overlay can only draw to its own surface, so you have to cover at least the entire screen to be able to draw the beam wherever (actually, you only need to cover what the beam needs to draw to, but doing it that way requires a fair bit of resizing and repositioning the overlay)

    2. 'clear' just erases what's been drawn to the overlay; if you don't do this, your beam will pretty much "smear" all over the screen
    Thanks! That clears up a lot of questions.

    What could be the reason for my overlay surface not showing?
    I have noticed that when I use the overlay redux that the colour I have filled it with isn't showing when I run my game. I only see the normal background colour of my frame.
    Any ideas why that would be?
    I guess this is why it's not working at the moment and I'm not getting a beam.
    I can see the 'point' is correctly placed on the background when I press fire, but I just don't get a beam (and I can't actually see the overlay image ingame)

    I copied the properties of the Overlay redux precisely like they were in the example by Jaffob, but when I run the game, it shows the frames normal background colour...

    Thanks for all the help thus far.

  9. #9
    No Products Registered

    Join Date
    Jul 2006
    Location
    Umeå, Sweden
    Posts
    1,090
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sniper rifle / beam collision

    Check this out
    http://theclickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=128594

  10. #10
    No Products Registered

    Join Date
    Dec 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: sniper rifle / beam collision

    Thanks. Nice approach to the problem too.
    Actually Jaffob's example (the one I've been following) works fine - except the line drawing part.

    The problem I have at the moment is understanding why my overlay redux is just not showing up as soon as I run the game. (it shows in the frame editor)

    Why my line is not drawing/showing up.

    (what I've done for now is to scale a pixels x scale to the compensate for not having 'draw line' work (as the detection system works) - but it doesn't seem to be as accurate as using 'draw line')

Similar Threads

  1. How to make rifle cartriges fly nice?
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 12th February 2011, 10:53 PM
  2. Sniper Game
    By csj1 in forum Hardware Accelerated Runtime
    Replies: 2
    Last Post: 15th June 2008, 07:36 PM
  3. sniper widget
    By Pritchy96 in forum Widgets
    Replies: 0
    Last Post: 2nd March 2008, 04:48 PM
  4. Overlay Redux Laser Beam Collision?
    By YAS in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 18th August 2007, 07:13 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
  •