Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 clearing screens in games,or parts of screens
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Blade




PostPosted: 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?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Fri Apr 04, 2003 2:42 pm   Post subject: (No 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).
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Blade




PostPosted: Fri Apr 04, 2003 3:49 pm   Post subject: (No subject)

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




PostPosted: Fri Apr 04, 2003 4:42 pm   Post subject: (No 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.



test.t
 Description:
comparing background restoration

Download
 Filename:  test.t
 Filesize:  1.3 KB
 Downloaded:  296 Time(s)

Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Pear-i




PostPosted: Sat Apr 05, 2003 11:54 pm   Post subject: (No 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?
Asok




PostPosted: Sat Apr 05, 2003 11:57 pm   Post subject: (No subject)

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




PostPosted: Sat Apr 05, 2003 11:58 pm   Post subject: (No 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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: