Graphics

 BBS: Inland Empire Archive
Date: 02-13-94 (08:56)             Number: 298
From: STEVE DEMO                   Refer#: 61
  To: ALL                           Recvd: NO  
Subj: Graphics                       Conf: (2) Quik_Bas
'Below you will find code to do Sprite annimation in Basic that should
'work except that it is picking up a random error somewhere. I am
'asumeing it could be just the way Basic stores GET arrays If you can
'shed some light on this I would appreciate it VERY much.
'
'* Contents of a *Array* obtained by GET : first 2 bytes Headder info
' Color's in a *INTEGER ARRAY* break down to the following in
' Screen mode 13 : 1 = 257, 2 = 514,3 = 771, 4 = 1028, 5 = 1285, ect..
' as you can see all divisable by 257 evenly .
' (well they should be read on)
'
'Thanks Steve Demo
'
'$DYNAMIC
DEFINT A-Z
SCREEN 13
size% = 328                       '** get size of Array
REDIM Array%(0 TO size%)          '** Allocate Array size
REDIM Array2%(0 TO size%)         '**
CIRCLE (165, 100), 9, 4           '** Draws a face.
PAINT (165, 100), 90, 4
CIRCLE (165, 100), 8, 4, 0, 3.14
CIRCLE (165, 100), 9, 90, 3.14, 6.28
CIRCLE (162, 99), 3, 1
PAINT (162, 99), 0, 1
CIRCLE (168, 99), 3, 1
PAINT (168, 99), 0, 1
CIRCLE (165, 103), 3, 1, 3.43, 5.83
BEEP: SLEEP
GET (150, 90)-(180, 110), Array%(0)    '** Grab face
PAINT (1, 1), 7                        '** Draw BackGround
GET (150, 90)-(180, 110), Array2%(0)   '** Grab GackGround
FOR x = 0 TO size%                                '** Create Sprite
   IF Array%(x) >= 257 THEN Array2%(x) = Array%(x)  '** Swap Non 0 with
NEXT x                                            '** Face Array
PUT (150, 90), Array2%(0), PSET                   '*** place the Array
LINE (150, 90)-(180, 110), 10, B  '*** just to show what Array contains ***
BEEP: SLEEP
'** Display The contents of the combined Array
'** dont need to see the first 2 bytes of sprite
'** they are Headder info only
SCREEN 0: WIDTH 80
FOR x = 3 TO size%
 PRINT Array2%(x), x, INT(Array2%(x) / 257);
 IF Array2%(x) MOD 257 THEN PRINT "<---Error something Screwy in St.Louie";
 a$ = INPUT$(1)
 PRINT
 IF a$ = CHR$(27) THEN END
NEXT x
PRINT "Whats up doc ?"
END
$$57

-G

--- Maximus 2.01wb
 * Origin: The International Saskatoon,SK CANADA(306)384-7685 (1:140/15)
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