Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Ryan Timothy B on Sun 14/12/2008 20:46:00

Title: Editing Hotspots or even Walk-Behinds in-game?
Post by: Ryan Timothy B on Sun 14/12/2008 20:46:00
Is it possible to edit Hotspots or Walk-Behinds in-game?

I need to make destructible terrain similar to the Worms2 game.  Where the shotgun in that game can destroy circular sections of the side scrolling background and allow the character (worm) to walk on what was once the mountain.

I'm planning on making a Worms2 type game, and without this I don't really want to attempt it.



Now IF the Hotspots can't be manipulated with the drawing surface feature, I've been thinking about creating an array that stores the x and y coords and radius of where the weapon had hit the surface.  Then I would have the global script check to see if the character is within any of the slightly larger 'square' sections of the circles radius (with a square you wouldn't have to do the radius calculations each and every time even if the character is no where near a damaged section of the map).  Once they are, the character would interact with the new damaged section of the background.
Now this I believe I could do, I'm just hoping someone knows of an easier way that just allows you to edit the hotspots while in-game.
Title: Re: Editing Hotspots or even Walk-Behinds in-game?
Post by: Dualnames on Sun 14/12/2008 20:50:12
Quote from: Ryan Timothy on Sun 14/12/2008 20:46:00
Is it possible to edit Hotspots or Walk-Behinds in-game?

I need to make destructible terrain similar to the Worms2 game.  Where the shotgun in that game can destroy circular sections of the side scrolling background and allow the character (worm) to walk on what was once the mountain.

I'm planning on making a Worms2 type game, and without this I don't really want to attempt it.


You mean as changing their areas? Drawing hotspots in-game? No, that is not possible, though it would be cool. Same for walk-behinds.
Title: Re: Editing Hotspots or even Walk-Behinds in-game?
Post by: Ryan Timothy B on Sun 14/12/2008 23:33:12
What a shame.
Title: Re: Editing Hotspots or even Walk-Behinds in-game?
Post by: Khris on Mon 15/12/2008 14:08:23
You don't need hotspots.
Keep a 2-color copy of the current background in a second DrawingSurface, then erase terrain on both the actual screen and the copy.
To check if there's terrain or not, use DrawingSurface.GetPixel.
Title: Re: Editing Hotspots or even Walk-Behinds in-game?
Post by: Ryan Timothy B on Mon 15/12/2008 23:28:03
Quote from: KhrisMUC on Mon 15/12/2008 14:08:23
You don't need hotspots.
Keep a 2-color copy of the current background in a second DrawingSurface, then erase terrain on both the actual screen and the copy.
To check if there's terrain or not, use DrawingSurface.GetPixel.

That sounds like a good idea.
Thanks Khris.  You just saved me from tons of unneeded math equations. :P