Graphics

 BBS: Inland Empire Archive
Date: 04-14-92 (01:45)             Number: 145
From: JEAN CREPEAU                 Refer#: 25
  To: BRYAN FLEMING                 Recvd: NO  
Subj: Graphics                       Conf: (2) Quik_Bas
In a message to ALL, BRYAN FLEMING wrote:
BF=> hi!      Is there  a way to an object across another but not  have the
    object that is underneath be erased and also not have to draww it  over
    again....sort of putting the object on the screen permanently (ie....in
    an adventure game the man will walk along town and he is the only thing
    to be  drawn again  while the  buildings are  not CLSed  and then drawn
    again      thanks

        There are many ways to do that. First, you can PUT (x,y),array,XOR.
This will XOR the colors. To  "undisplay" your character, you just have  to
do a PUT (x,y),array,XR at exactly the same location. The only problem with
this method...  your character's  colors will  be modified  if it  walks on
different background pictures...

        The best way to do it, is
1. You GET (x1,y1)-(x2,y2),savearray  at the location where  your character
    is being displayed (to avoid redrawing the entire building)
2. You PUT (x1,y1),characterarray,OR to draw your character
3. You compute the next move
4. You PUT (x1,y1),savearray,PSET
5. Go back to 1.

        There is  another problem  with this  one. Your  colors may  not be
always the ones you want (because of the OR). You can correct this by using
2 arrays for  your character... the  first one resets  all the points  that
have to be erased on the background (PUT (x1,y1),array1,AND) and the second
one contains  your character  (PUT (x1,y1),array2,OR  or XOR  or simply PUT
(x1,y1),array2).
                Jean
---
 * Origin: INTERACESS Montreal (QC) Canada (514) 528-1415 (1:167/280)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET