The Daily Click ::. Forums ::. Klik Coding Help ::. Multi-point laser
 

Post Reply  Post Oekaki 
 

Posted By Message

vetmora120



Registered
  07/01/2010
Points
  273
11th August, 2012 at 11/08/2012 11:12:57 -

Hi all,

Just wondering if it is at all possible to create a laser with multiple "bends". In more depth, I want to create an instant laser and have it so when it collides with a certain object, it will bend in the desired direction. Imagine glass blocks or mirrors and when said laser hits them it bends itself in the direction of the block, etc.

Is this possible in MMF2 and if so, what would be the best way to go about it. Appreciate any feedback.

Thanks in advance!

 
n/a

monkeytherat

Hero of Time Jr

Registered
  07/11/2010
Points
  1293

VIP MemberI donated an open source project
11th August, 2012 at 11/08/2012 19:00:42 -

I'm sure it's possible, but it would be very hard on the system (even a 1-directional laser is pretty taxing). If it is possible to do it well, though, I bet Sketchy would be able to do it, he's pretty much Jesus.

 
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1960

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
11th August, 2012 at 11/08/2012 21:32:54 -

@Monkeytherat: Lol, not quite, but thanks anyway
@vetrmora120: I presume you're "Fawfulfan", off the Clickteam forums? Either that, or someone else just happens to be asking the same question.

I'm pretty sure it's possible, and without hurting performance too much (at least if you're using HWA). I had a quick go at making an example, but it's spectacularly buggy - the beam likes to bounce off thin air quite a lot, which isn't ideal.

http://skydrive.live.com/redir?resid=B1E7EE094271BBDA!540

I think maybe using the beam's action point isn't the way forward, but it might be worth trying to check for collisions by just moving a 1x1 pixel detector (in addition to the beam itself) - just to see if that makes a difference.
Alternatively, I may just have made a mistake somewhere...

I'll have another look at it tomorrow, if you haven't already found a solution by then.

 
n/a

vetmora120



Registered
  07/01/2010
Points
  273
12th August, 2012 at 12/08/2012 09:35:16 -

Nah my name is Vetmora on there too. Strange coincidence though, hey... Thanks for posting the example Sketchy, I'll have a look at it now.

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1960

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
12th August, 2012 at 12/08/2012 13:40:45 -

Heh, that is strange - they're literally asking the exact same question.
I made a new and improved version, using the surface object to draw the beams. It's a *lot* less buggy than the previous version, but unfortunately there are still glitches, which means it's unlikely to be useable in a game

Anyway, for what it's worth: http://skydrive.live.com/redir?resid=B1E7EE094271BBDA!541

 
n/a

SolarB



Registered
  26/12/2011
Points
  563
13th August, 2012 at 13/08/2012 09:49:50 -

I think this can be done with Box2D's raycasting. that is, if you don't mind using box2d. There's an example of it in the box2d files.

 
My Open Source Examples: http://bit.ly/YyUFUh
   

Post Reply



 



Advertisement

Worth A Click