I am trying to make a rotating torch, I read the previous discussions but I was Not getting a clue.
I used a triangular texture for light object and I just want that it should rotate in the direction of mouse pointer or joystick, but I failed in rotating the light object.
I am making a game in which there will be total darkness and only the lighted place will be visible.
I am thinking about 4 ideas:-
- to rotate the light according to texture.
- to make a transparent sprite which emits light.
- there will be a transparent sprite which can move and above it, a dark layer will be there,
Now the area or pixels covered by the sprite, that area will become transparent or removed from the drak layer. - to change the area of shadow of a object. (There will be a character, the object will stick to the character and the light will adjust it’s position with respect to that object, so on increasing the shadow area it will look like a torch with triangular light beam.)
These are my 4 idea, among the 4 - idea 3 is best, so I would request to help me in idea 3.