I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: Ario147 on June 30, 2013, 08:30:40 AM

Title: Flashlight effect.
Post by: Ario147 on June 30, 2013, 08:30:40 AM
I need someone to explain me how to make flashlight effect in game maker. I have the sprite for it, just don't know how to make it hide level, and light follow the kid, don't know how.
Title: Re: Flashlight effect.
Post by: Sephalos on June 30, 2013, 02:39:18 PM
To make a object follow to kid is pretty simple.
Make a object with the flashlight sprite and add this code in the "End Step Event"
x = player.x;
y = player.y;

Just make sure the origin of the sprite is set correctly.
Title: Re: Flashlight effect.
Post by: Ario147 on June 30, 2013, 03:29:38 PM
Could you make screen shots? I made it and nothing happend.
Title: Re: Flashlight effect.
Post by: Holyanus on June 30, 2013, 03:40:42 PM
It sounds simple, are you sure you did it right?
Title: Re: Flashlight effect.
Post by: Ario147 on June 30, 2013, 04:33:20 PM
I did, and after that i tried to change code, or to place the FlashLight object in the room, nothing D:
Title: Re: Flashlight effect.
Post by: Holyanus on June 30, 2013, 05:03:49 PM
Odd... Well, what do you mean change the code?
Title: Re: Flashlight effect.
Post by: Ario147 on June 30, 2013, 06:56:09 PM
when
x = player.x;
y = player.y;
haven't worked, i tried the
x = player;
y = player;

 :Kappa:
Title: Re: Flashlight effect.
Post by: Holyanus on June 30, 2013, 07:05:44 PM
It has to be following the player objects x and y, not just player.
Title: Re: Flashlight effect.
Post by: Ario147 on June 30, 2013, 07:10:22 PM
Don't work anyway.  :BibleThump:
Title: Re: Flashlight effect.
Post by: Holyanus on June 30, 2013, 07:11:16 PM
Don't work anyway.  :BibleThump:

Guess you will have to wait for Seph, it seems like it should work for everyone.
Title: Re: Flashlight effect.
Post by: Starz0r on June 30, 2013, 08:28:36 PM
Don't work anyway.  :BibleThump:

Guess you will have to wait for Seph, it seems like it should work for everyone.

Did you press the center button on the sprite?

(https://puu.sh/3sbXD.png)
Title: Re: Flashlight effect.
Post by: Sephalos on July 01, 2013, 06:05:07 AM
It really should have worked.

Make sure you assigned a sprite to the object.
Make sure it is visible.
Make sure the sprite is not 100% transparent.
Make sure the origin is set properly.
Make sure the object has no draw event.
Make sure the object is in the room.

 :OneHand:
Title: Re: Flashlight effect.
Post by: lemonxreaper on July 02, 2013, 04:24:44 AM
Also make sure the x and y tracking is in the right event type.