RealTime LIghting Demo!

Post here your demos and examples with the source files.
Forum rules
Always post the games with a screenshot.
The file must have the ged and data files (complete game source)
Use the forum attachment to post the files.
It is always better to use the first post to put the game files

RealTime LIghting Demo!

Postby Hblade » Tue Mar 20, 2012 7:17 pm

I hope someone can explain how to make this into a circle :P That'd be cool! :D
s.png


Lighting.zip
(424.46 KiB) Downloaded 342 times


HOW IT WORKS:
It uses a canvas, set the canvas to your color, then use the command "SetLight(x, y, width, height);"

But because of an unknown bug, when setting the y, make sure you set +half of height, like this:
Code: Select all
SetLight(xmouse, ymouse+32, 64, 64);

Otherwise, your light is gonna end up above the Y position you told it to.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4420
Joined: Fri Dec 08, 2006 11:14 pm
Score: 177 Give a positive score

Re: RealTime LIghting Demo!

Postby skydereign » Tue Mar 20, 2012 7:36 pm

I wouldn't use a canvas to make circles (at least how I think you are going about it). To do that you need to use putpixel, and it is slow. Nothing realtime about it. Anyway, take a look at the new ged (note you made it rather hard to use with the + and - adjustments based off of width). Also, just to teach you something, you were wasting a lot of loops doing the lineto method. The pen (from setpen) is a square. So you set its width or height, and just put the pixel at the position X, Y.
Attachments
Lighting.zip
(439.61 KiB) Downloaded 162 times
User avatar
skydereign
 
Posts: 3498
Joined: Mon Jul 28, 2008 8:29 am
Score: 580 Give a positive score

Re: RealTime LIghting Demo!

Postby Hblade » Tue Mar 20, 2012 7:40 pm

Oh wow :oops: tahnks sky.

This is fantastic!
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4420
Joined: Fri Dec 08, 2006 11:14 pm
Score: 177 Give a positive score

Re: RealTime LIghting Demo!

Postby bat78 » Sun Jul 08, 2012 9:21 pm

I make the circle decently for flashlight and add sequence.
Do u allow me to add the lighting into the one of my games hblade?
Future of "Project Game-Editor Revival" here
User avatar
bat78
 
Posts: 600
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 65 Give a positive score

Re: RealTime LIghting Demo!

Postby Hblade » Sat Jul 14, 2012 11:56 pm

Thats up to you lol :)
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4420
Joined: Fri Dec 08, 2006 11:14 pm
Score: 177 Give a positive score

Re: RealTime LIghting Demo!

Postby 247wkman » Wed Sep 26, 2012 1:50 am

I MADE A BETTER LIGHT BASE ON THE PREVIOUS EXAMPLE ABOVE! I ATTACHED THE RE-TWEEKED GED BELOW

Still messing around with geds to figure the what-can-do's of g.e (and still finding it sainer to navigate than game maker..)
I just got a reply from lclMetal on youtube when i mentioned how to use draw functions to make a filled circle to create canvas lamp circles that can intersect each other and it helped me re-aprouch using images instead of pen funtions agian. And this time i got it right!

Basically use a non alpherd image of a filled circle- g.e will ignore the border color leaving you with just the circle.
However, even if you set the transparency to nothing, canvas erase won't draw over it.
So what you get is a clean circle image that can rub out the blackness of your dark room and merge with other instances of itself drawn around other actors.
The only remaining problem is how do you control draw order to overide how it was originally written in the script, so that dimmer lights or lights that are dimming (like if the battery was running low) will be drawn over by any brighter lights you approuch.

(canvas light circle/ lantern circle / tourch light tourchlight / draw circle)
Attachments
RealAdventureTimeLightDemo.zip
(966.21 KiB) Downloaded 11 times
247wkman
 
Posts: 65
Joined: Mon Dec 13, 2010 3:55 pm
Score: 3 Give a positive score


Return to Game Demos

Who is online

Users browsing this forum: No registered users and 1 guest