1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-09-16 02:43:59 +00:00
qb64/programs/samples/pete/25lines/npplasma.bas
SMcNeill 6e01fc8dce Altered string compare routines (<,<=,>,>=) so they don't give false results with CHR$(0).
Added new _STRCMP and _STRICMP commands for quick string comparisons.
Cleaned up QB64 to finish removing the QUI (quick user insert) code and folders.
Altered UCASE and LCASE routines to be faster in some situations for us.
2014-09-22 08:19:03 -04:00

30 lines
1.2 KiB
QBasic

'///Non Palette rotated plasma
'///Relsoft 2003
'///Compile and see the speed. Didn't optimize it as much as I want though...
1 SCREEN 13
2 DIM Lsin1%(-1024 TO 1024), Lsin2%(-1024 TO 1024), Lsin3%(-1024 TO 1024)
3 FOR I% = -1024 TO 1024
4 Lsin1%(I%) = SIN(I% / (128)) * 256 'Play with these values
5 Lsin2%(I%) = SIN(I% / (64)) * 128 'for different types of fx
6 Lsin3%(I%) = SIN(I% / (32)) * 64 ';*)
7 IF I% > -1 AND I% < 256 THEN PALETTE I%, 65536 * (INT(32 - 31 * SIN(I% * 3.14151693# / 128))) + 256 * (INT(32 - 31 * SIN(I% * 3.14151693# / 64))) + (INT(32 - 31 * SIN(I% * 3.14151693# / 32)))
8 NEXT I%
9 DEF SEG = &HA000
10 Dir% = 1
11 DO
12 Counter& = (Counter& + Dir%)
13 IF Counter& > 600 THEN Dir% = -Dir%
14 IF Counter& < -600 THEN Dir% = -Dir%
15 Rot% = 64 * (((Counter& AND 1) = 1) OR 1)
16 StartOff& = 0
17 FOR y% = 0 TO 199
18 FOR x% = 0 TO 318
19 Rot% = -Rot%
20 C% = Lsin3%(x% + Rot% - Counter&) + Lsin1%(x% + Rot% + Counter&) + Lsin2%(y% + Rot%)
21 POKE StartOff& + x%, C%
22 NEXT x%
23 StartOff& = StartOff& + 320
24 NEXT y%
25 LOOP UNTIL INKEY$ <> ""