Computer Science Canada

clearing screens in games,or parts of screens

Author:  Blade [ Fri Apr 04, 2003 12:52 pm ]
Post subject:  clearing screens in games,or parts of screens

ok, i'm making a game, and i need to clear a part of the screen without losing whatevers on the background... like lets say my dude is runnin around like a freak, it leaves different parts of him behind (wouldnt expect anything else would you? Wink ) but i need to clear it without losing whatever is behind it, so if i write anything overtop of it, it will clear the part of my background... whats the most efficient way to do this?

Author:  Tony [ Fri Apr 04, 2003 2:42 pm ]
Post subject: 

the easiest way is to redraw the whole background.

the more efficient way would be to store the background in the array pixel by pixel and just restore the part of the background that was altered. (a box on top of your character).

Author:  Blade [ Fri Apr 04, 2003 3:49 pm ]
Post subject: 

easiest would be most efficient for speed... more efficient would take hella time to play

Author:  Tony [ Fri Apr 04, 2003 4:42 pm ]
Post subject: 

here's a file attached comparing differen methods of file restoration.

basically the fastest way is to break the background up into smaller images and restore only the required areas of the background.

Author:  Pear-i [ Sat Apr 05, 2003 11:54 pm ]
Post subject: 

i'm trying to do a fog of war thing for my rpg,
so like the maze is covered with 'fog', till you walk into it..
would i use the same method?

Author:  Asok [ Sat Apr 05, 2003 11:57 pm ]
Post subject: 

reffer to the "text flashlight" in the turing submissions section, that can be modified as a "fog of war" effect.

Author:  Tony [ Sat Apr 05, 2003 11:58 pm ]
Post subject: 

well the maze is made up of squares/tiles, isnt it?

I suppose that you can have two pictures of each tile normal + fogged

now as you move around, you just put new pictures over squares that change. Such as if you move 1 up, you change that to visible and one back to foggy (well more then 1, just example)

so yes, it would be like partial background restoration


: