Page 1 of 1

pixelremove function?

PostPosted: Thu Apr 15, 2010 4:50 pm
by Hblade
Ever played a game called Worms? You know how when you hit the ground, it darkened those pixels and made then un fit with collision? So like, if you walk into a part thats been shot(It looks like a hole but it's actually the pixels that got darker), you wont collide with the pixels that are darker.

I'd love for this feature to be in GE, allowing you to make a digging game or a game where you have to blow up stuff.

Re: pixelremove function?

PostPosted: Thu Apr 15, 2010 5:13 pm
by MrJolteon
the worms games i've played, these pixels disappear. That is Worms 2006-2008 on a cellphone :P

Re: pixelremove function?

PostPosted: Thu Apr 15, 2010 5:16 pm
by Hblade
Oh :D well that'll be good too :3

Re: pixelremove function?

PostPosted: Thu Apr 15, 2010 11:20 pm
by krenisis
Well you can do this
1) have 2 pixels color and dark
2) when your actor collides with color destroy actor color pixel and create dark pixel.
3) Make the dark pixel so that there is no collision with that

Thats 1 way of doing it but iam sure there are better ways

Re: pixelremove function?

PostPosted: Thu Apr 15, 2010 11:40 pm
by Hblade
Or you could draw the whole wall / level via canvas actor and use a customized collision based on the x and y positions and when it "Collides" with that pixel it moves it or destorys it, causing pixel perfect gaming but that would cause lag, as will the method you gave me lol :D

Nice try though :3

Re: pixelremove function?

PostPosted: Sat Jul 31, 2010 9:43 am
by DilloDude
You can use a canvas to draw the ground on, and do collisions normally with it. For collisions, you can either write your own draw script, or use draw_from with a transparent actor to erase sections.
If you wanted it to appear darkened instead, you could have a second backgroud canvas with the same image but darker.

Re: pixelremove function?

PostPosted: Sat Jul 31, 2010 10:06 am
by Bee-Ant
Or...
You can trick it by using this sprite
Image

Re: pixelremove function?

PostPosted: Mon Aug 09, 2010 1:28 pm
by DBGames
a little off topic, but that sprite hurts my eyes a bit.

Re: pixelremove function?

PostPosted: Thu Feb 26, 2015 1:36 am
by 247wkman
i figured out you can create holes in a filled canvas viewtopic.php?f=6&t=11748&p=87690&hilit=realtime+lighting#p87690.
you simply create an actor that represents the shape of the ground you want your holes to be and set the transparency to max so that you get only a silloette of the actor in the canvas.
it works for spotlights- which are just shapes erasing a dark screen, and will work for blasting holes in a terrain image drawn in the canvas. as you can collide with the drawn elements of a convas and move around in parts that have been erased you should be able to fire missle/bullets at the canvas- triggering the drawing of further instances of tranparent hole actors in the canvas to dig around etc. i'm not sure how you would go about healing the turrain after though.

Re: pixelremove function?

PostPosted: Mon Mar 02, 2015 2:11 am
by 247wkman
oh hang on.
it seems i got to figure out how to make canvas acknowlege each instance of each actor created to make it draw a new additional light disc/terrain eraser over them. right now creating multiple instances of an actor set to be the target locion of the canvas draw point are ignored. only the first actor is drawn over.