double flashlights: headlights possible?

Started by spook1, Wed 02/06/2004 21:49:15

Previous topic - Next topic

spook1

Is it possible to have two spots of light similar to the flashlightplugin?
I intend to make a vehicle with two headlights moving in a dark scene, trying to stay on the road. For specific nature of the puzzle I need two separate beams of light?

can anyone reflect on this?

regardss,
martijn

Scorpiorus

The only way I see is to create a large black object with two spots of light being cut out of it (or draw these spots using the alpha channel, if the game is at 32bit mode).

SSH

THink laterally.... do a motorbike and thus only need one headlight...
12

Akumayo

Actually, I think that the object is a good idea.  You could make a big black object with two cutouts where the room could be seen, similar to looking through binoculars...  Anyway, that would work just fine.  The motorbike would make more sense only if you want the plugin to take up extra space on your game ;)
"Power is not a means - it is an end."

Barbarian

#4
You could probably get the desired affect using a "mask" . The below is quoted from the tutorial.txt  for the flashlight Plugin:

"Masks
=====

If your scenery includes e.g. walkbehind-areas and a character "carries" the light spot, then light on this area would depend on wether the character is in front of or behind the area.

How to do:
- paint a room mask with your favorite paint programm in Hi-color (white = light; black = no light)
- import it into the sprite manager from the file with transparent color set to palette index 0.
- Use SetFlashlightMask with the sprite slot number to which you imported the mask
- Use SetFlashlightMask (-1) to show the normal effect without mask

Note:
The mask must have the same size as the room.

Caution:
If you notice that white or black are changed into transparent (red) then the import wasn't successful. Please try again with correct settings (see above).

Usage:
You can use hotspots (e.g. player stands on hotspot) to run a script in which you switch on/off the mask; or you can check coordinates of the character or of the light spot."
Conan: "To crush your enemies, see them driven before you, and to hear the lamentation of the women!"
Mongol General: "That is good."

Blade of Rage: www.BladeOfRage.com

spook1

Thanks for all the suggestions.
All togehter I conclude that I must find another puzzle.
The design is for an electricity learninggame. Idea was that you have an electric caterpillarlike vehicle with two headlights. By turning on a headlight at e.g. the right side, the current will drop for the engine and the vehicle will turn.
learning goal: learn to think non-locally, adding a component to a circuit can affect other components in the circuit.

Therefore I would need to turn on and off the headlighhts separately and move the spots over the screen atthe same time. It will be too difficult to program this I am afraid.

maybe I will go with the option for two very big (ten times the screen dimensions) objects with a hole in it. Moving tghese object would reflect the postition of the light circles.\

Again thanks for thinking along, and I'll keep informed about the result in the critics lounge.

martijn

SMF spam blocked by CleanTalk