This video tutorial shows you how you can make a light system in gamemaker studio 2. This code is based on the original yoyo site in the link below.
▶ Gamemaker Studio:
▶ Trial limitations:
♥ My free game Clunky souls:
♥ My assets:
Get some assets at itch.io
♥ Support me and get fresh game art and game maker projects every month:
Follow me on:
Nguồn: https://bhutanjournals.com/
Xem thêm bài viết khác: https://bhutanjournals.com/game/
Hey 1up! Love your tutorials, learning a lot! Just a question: the light I setted in my game passes through the wall. How can I get it not to do so?
Nice video but i didnt understand 7:46 why we used x-_cx
Is it possible to have objects drawn so that the lighting effects apply? This works great for the tiles, but much of my environment consists of objects.
First of all I would like to say thank you for all your videos they are the best! Keep up the good work 😀
Now I'm not sure if this is just me since noone else commented on it, but when I put 2 sources to close to each other, they clash and make this wierd line like this: http://prntscr.com/s2p2bb
Is there any work around this that you're aware of?
You really needed to press Ctrl+- or Ctrl++ because your font looks very blurry
i am trying to have the light not affect certain layers for example in a sidescroller the background is not affected by the light but another layer on top is, the layer on top is not covering everything so there're holes where you can see the background like a window when you hold a candle next to it, it lights the window frame but everything you can see through the window shouldn't light up if it's far away… i managed to get it work the way i wanted by manually drawing the shape of the layer which the shadows must affect and creating a background layer with the alpha to cover everything else that i don't want the lights to affect, so they will still be dark. I used the code here to instead of drawing a rectangle to draw that new shadow sprite. The problem i encountered is dealing with objects that move around, since if they pass through the window they will light up so i had to change the code to also draw the shape of that object so they will stay in the dark, if the object is holding the light then is all good but if it's not then it leaves a trail of his shadow in the windows, if anyone has any idea of how this is properly done or how to remove this trail i would very much appreciate it
Works perfectly, thanks!
I got some people where their light surface isn't working properly, so here is a link where you can find the a cookie cutter project or just the local import for a surface with a light cone/radial light:
https://www.patreon.com/posts/youtube-light-32843368
Everything is totally free here, CC0 made by me.
Sorry but i don't understand :
what does the surface variable correspond to?
How would i specify an area that has no darkness, but isn't attached to an object? I ask because in a side scroller that has an open sky, the sky would have no surface for shadows to gather on. Seeing as this area is so huge and is shaped differently depending on the layout of the level (mountains in my case), i'm not sure how this lighting system would apply to it. Would it be possible to have the darkness shape contour to all objects/tiles beneath it, that way leaving the sky blank and simulating what i'm after? If not, are there other methods that would achieve this?
If I put that light on my player, how can I do to follow me around the room?
because I have the light but when I am moving along the map the darkness is gone along with the light
Hey, thank you for doing these tutorials.
This is awesome! I do have a question though. In my day/night cycle, I have a black wall of darkness that moves across the screen to simulate the sunset. As it moves across the screen, I would want any light sources to be drawn one pixel at a time until it's completely covered by the darkness. At that point, the entire light would be drawn. How would I do this? Should I use draw_sprite_part and add to the x value over time?
Also, how did you create the light sprite exactly? Could you send the sprite?
Hi!
I have a problem! if I did for oPlayer in Draw – Draw_self();
those lights don't work for him? how can this be corrected?
obrigado, ajudou demais
Nice! I m going to use this system NOW
🙂
Keep the coming, love seeing these videos!
thank you! loving these tutorials