The Daily Click ::. Forums ::. Klik Coding Help ::. Reflective Laser Question,
 

Post Reply  Post Oekaki 
 

Posted By Message

Kai Proton



Registered
  31/01/2005
Points
  201

Wii Owner
6th November, 2007 at 15:38:28 -

I seem to have become involved with an R-type type shooter,

and im sure one of the Weapons will be a laser that reflects off the walls in a vector line style,

can anyone help, I searched for Laser. .because Im sure I saw it on here a few days ago...

Thanks

K.

 
----------------------
Time for a Sexy Party!
----------------------

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
6th November, 2007 at 21:47:20 -

i would assume you need to use some sort of draw line extension, way above my head though. sorry and good luck

 
n/a

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
6th November, 2007 at 22:23:04 -

Do you want this "laser" to be an instantaneous beam that reflects, or a fast traveling particle? Either way it can be achieved by using the fast loop object in combination with the advanced math object; move the object according to cartesian coordinates with X = cos(angle) * distance, on each fastloop. Likewise with Y. The real trick to this is trying to determine which angle the reflect the object at. And quite frankly, this IS no easy solution to that problem. You can either have the impact angle of each background object predefined (verticle obstactles reflect the X velocity, but not the Y, while horizontal obstactles are vice-versa). That, of course, doesn't work if your shooter has backgrounds at angles other then just straight up and down, which I rather hope it does.


If you are really set on finding a method for the angle of reflection, you're going to have to get into complicated stuff. You'd have to create some kind of detectors that loop around the object in a 360 degree angle until they determine the incidence angle, and use that to calculate the reflection angle. Its alot easier to predefine the angle on every object in your game, but that restricts you from using backgrounds as a reflection point.

The key answer is to only allow reflection off specific objects; active object mirrors, for example. This won't get you as neat as an effect as you want, but it will require FAR less work.

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Kai Proton



Registered
  31/01/2005
Points
  201

Wii Owner
7th November, 2007 at 15:07:06 -

Thanks for the info,

I was thinking of a short beam shot from the ship,

I could use some Actives that position the laser beams and have them travel with the player at certain positions, that would allow me to have them as mirrors

K.

 
----------------------
Time for a Sexy Party!
----------------------
   

Post Reply



 



Advertisement

Worth A Click