[ScreenSaver] v1.2

This commit is contained in:
Tomek Wójcik 2022-10-23 19:27:26 +02:00
parent edf0f9c26a
commit 9459cb0f29
4 changed files with 259 additions and 259 deletions

BIN
ScreenSaver/ScreenSaver.AMOS Normal file → Executable file

Binary file not shown.

518
ScreenSaver/ScreenSaver.AMOS.txt Normal file → Executable file
View File

@ -1,259 +1,259 @@
' Screen Saver v1.1 ' Screen Saver v1.2
' Created By Tomek Wojcik <tomek@bthlabs.pl> ' Created By Tomek Wojcik <tomek@bthlabs.pl>
' Copyright 2020-present by BTHLabs (https://bthlabs.pl) ' Copyright 2020-present by BTHLabs (https://bthlabs.pl)
' Licensed under terms of MIT License ' Licensed under terms of MIT License
' *** Globals ' *** Globals
WIDTH=320 WIDTH=320
HEIGHT=200 HEIGHT=200
PADDING=10 PADDING=10
XMIN=PADDING XMIN=PADDING
XMAX=WIDTH-PADDING XMAX=WIDTH-PADDING
YMIN=PADDING YMIN=PADDING
YMAX=HEIGHT-PADDING YMAX=HEIGHT-PADDING
PAL_MIN=4 PAL_MIN=4
PAL_MAX=15 PAL_MAX=15
Global WIDTH,HEIGHT,PADDING,XMIN,YMIN,XMAX,YMAX Global WIDTH,HEIGHT,PADDING,XMIN,YMIN,XMAX,YMAX
' *** Setup ' *** Setup
Degree Degree
Auto View Off Auto View Off
Default Palette $0,$FFF,$0,$0,$BA6,$B30,$625,$FC0,$690,$CB6,$373,$F0,$8EE,$AAA,$737,$A26 Default Palette $0,$FFF,$0,$0,$BA6,$B30,$625,$FC0,$690,$CB6,$373,$F0,$8EE,$AAA,$737,$A26
Screen Open 0,WIDTH,HEIGHT,16,Lowres : Screen Show 0 Screen Open 0,WIDTH,HEIGHT,16,Lowres : Screen Show 0
Screen Open 1,WIDTH,HEIGHT,16,Lowres : Screen Hide 1 Screen Open 1,WIDTH,HEIGHT,16,Lowres : Screen Hide 1
Screen Open 2,WIDTH,HEIGHT,16,Lowres : Screen Hide 2 Screen Open 2,WIDTH,HEIGHT,16,Lowres : Screen Hide 2
Hide : Flash Off Hide : Flash Off
Screen 0 : Curs Off Screen 0 : Curs Off
Screen 1 : Curs Off Screen 1 : Curs Off
Screen 2 : Curs Off Screen 2 : Curs Off
' *** Main Stuff ' *** Main Stuff
Procedure MAIN_DRAW_BORDER Procedure MAIN_DRAW_BORDER
Cls 0 Cls 0
Ink 1,0 Ink 1,0
Box 4,4 To 316,196 Box 4,4 To 316,196
Pen 1 : Paper 0 Pen 1 : Paper 0
Locate 0,0 Locate 0,0
Centre "Screen Saver" Centre "Screen Saver"
Locate 0,24 Locate 0,24
Centre "By BTHLabs. For teh lulz." Centre "By BTHLabs. For teh lulz."
Locate 35,0 : Pen 13 : Paper 0 Locate 35,0 : Pen 13 : Paper 0
Print "v1.1"; Print "v1.2";
End Proc End Proc
Screen 0 Screen 0
MAIN_DRAW_BORDER MAIN_DRAW_BORDER
View View
' *** The Rect Module ' *** The Rect Module
RECT_PEN_MIN=4 RECT_PEN_MIN=4
RECT_PEN_MAX=15 RECT_PEN_MAX=15
RECT_MIN_SIZE=8 RECT_MIN_SIZE=8
Global RECT_PEN_MIN,RECT_PEN_MAX,RECT_MIN_SIZE Global RECT_PEN_MIN,RECT_PEN_MAX,RECT_MIN_SIZE
Procedure RECT_TICK Procedure RECT_TICK
If Timer mod 3=0 If Timer mod 3=0
Randomize Timer Randomize Timer
RECT_PEN=RECT_PEN_MIN+Rnd(RECT_PEN_MAX-RECT_PEN_MIN) RECT_PEN=RECT_PEN_MIN+Rnd(RECT_PEN_MAX-RECT_PEN_MIN)
RECT_WIDTH=RECT_MIN_SIZE+Rnd(XMAX-PADDING-RECT_MIN_SIZE) RECT_WIDTH=RECT_MIN_SIZE+Rnd(XMAX-PADDING-RECT_MIN_SIZE)
RECT_HEIGHT=RECT_MIN_SIZE+Rnd(YMAX-PADDING-RECT_MIN_SIZE) RECT_HEIGHT=RECT_MIN_SIZE+Rnd(YMAX-PADDING-RECT_MIN_SIZE)
If RECT_WIDTH=XMAX-PADDING If RECT_WIDTH=XMAX-PADDING
RECT_X=0 RECT_X=0
Else Else
RECT_X=Rnd(XMAX-PADDING-RECT_WIDTH) RECT_X=Rnd(XMAX-PADDING-RECT_WIDTH)
End If End If
If RECT_HEIGHT=YMAX-PADDING If RECT_HEIGHT=YMAX-PADDING
RECT_Y=0 RECT_Y=0
Else Else
RECT_Y=Rnd(YMAX-PADDING-RECT_HEIGHT) RECT_Y=Rnd(YMAX-PADDING-RECT_HEIGHT)
End If End If
Ink RECT_PEN,RECT_PEN Ink RECT_PEN,RECT_PEN
RECT_FX=XMIN+RECT_X RECT_FX=XMIN+RECT_X
RECT_FY=YMIN+RECT_Y RECT_FY=YMIN+RECT_Y
RECT_TX=RECT_FX+RECT_WIDTH RECT_TX=RECT_FX+RECT_WIDTH
RECT_TY=RECT_FY+RECT_HEIGHT RECT_TY=RECT_FY+RECT_HEIGHT
Bar RECT_FX,RECT_FY To RECT_TX,RECT_TY Bar RECT_FX,RECT_FY To RECT_TX,RECT_TY
End If End If
End Proc End Proc
' *** The Radar Module ' *** The Radar Module
RADAR_CX=WIDTH/2 RADAR_CX=WIDTH/2
RADAR_CY=HEIGHT/2 RADAR_CY=HEIGHT/2
RADAR_RADIUS=64 RADAR_RADIUS=64
RADAR_STEP=0 RADAR_STEP=0
RADAR_MAX_STEP=35 RADAR_MAX_STEP=35
Dim RADAR_POINTS(36,2) Dim RADAR_POINTS(36,2)
Global RADAR_CX,RADAR_CY,RADAR_RADIUS,RADAR_STEP,RADAR_MAX_STEP,RADAR_POINTS() Global RADAR_CX,RADAR_CY,RADAR_RADIUS,RADAR_STEP,RADAR_MAX_STEP,RADAR_POINTS()
Procedure RADAR_INIT Procedure RADAR_INIT
MAIN_DRAW_BORDER MAIN_DRAW_BORDER
RADAR_STEP=0 RADAR_STEP=0
For I=0 To RADAR_MAX_STEP For I=0 To RADAR_MAX_STEP
RADAR_POINTS(I,0)=0 RADAR_POINTS(I,0)=0
RADAR_POINTS(I,1)=0 RADAR_POINTS(I,1)=0
Next I Next I
Ink 1,0 Ink 1,0
Circle RADAR_CX,RADAR_CY,RADAR_RADIUS Circle RADAR_CX,RADAR_CY,RADAR_RADIUS
Ink 10,0 Ink 10,0
Paint RADAR_CX,RADAR_CY Paint RADAR_CX,RADAR_CY
Ink 1,0 Ink 1,0
Circle RADAR_CX,RADAR_CY,1 Circle RADAR_CX,RADAR_CY,1
Ink 11,0 Ink 11,0
Circle RADAR_CX,RADAR_CY,48 Circle RADAR_CX,RADAR_CY,48
Circle RADAR_CX,RADAR_CY,32 Circle RADAR_CX,RADAR_CY,32
Circle RADAR_CX,RADAR_CY,16 Circle RADAR_CX,RADAR_CY,16
End Proc End Proc
Procedure RADAR_TICK Procedure RADAR_TICK
Screen Copy 2 To 1 Screen Copy 2 To 1
Randomize Timer Randomize Timer
RADAR_ANGLE=10*RADAR_STEP RADAR_ANGLE=10*RADAR_STEP
RADAR_POINT_DIST=8+Rnd(RADAR_RADIUS-10) RADAR_POINT_DIST=8+Rnd(RADAR_RADIUS-10)
RADAR_POINT_X=RADAR_POINT_DIST*Cos(RADAR_ANGLE) RADAR_POINT_X=RADAR_POINT_DIST*Cos(RADAR_ANGLE)
RADAR_POINT_Y=RADAR_POINT_DIST*Sin(RADAR_ANGLE) RADAR_POINT_Y=RADAR_POINT_DIST*Sin(RADAR_ANGLE)
RADAR_POINTS(RADAR_STEP,0)=RADAR_POINT_X RADAR_POINTS(RADAR_STEP,0)=RADAR_POINT_X
RADAR_POINTS(RADAR_STEP,1)=RADAR_POINT_Y RADAR_POINTS(RADAR_STEP,1)=RADAR_POINT_Y
Ink 7,0 Ink 7,0
For I=0 To RADAR_MAX_STEP For I=0 To RADAR_MAX_STEP
If RADAR_POINTS(I,0)<>0 and RADAR_POINTS(I,1)<>0 If RADAR_POINTS(I,0)<>0 and RADAR_POINTS(I,1)<>0
Plot RADAR_CX-RADAR_POINTS(I,0),RADAR_CY-RADAR_POINTS(I,1) Plot RADAR_CX-RADAR_POINTS(I,0),RADAR_CY-RADAR_POINTS(I,1)
End If End If
Next I Next I
If RADAR_STEP=RADAR_MAX_STEP If RADAR_STEP=RADAR_MAX_STEP
RADAR_STEP=0 RADAR_STEP=0
Else Else
RADAR_STEP=RADAR_STEP+1 RADAR_STEP=RADAR_STEP+1
End If End If
RADAR_ANGLE=10*RADAR_STEP RADAR_ANGLE=10*RADAR_STEP
RADAR_HAND_X=(RADAR_RADIUS)*Cos(RADAR_ANGLE) RADAR_HAND_X=(RADAR_RADIUS)*Cos(RADAR_ANGLE)
RADAR_HAND_Y=(RADAR_RADIUS)*Sin(RADAR_ANGLE) RADAR_HAND_Y=(RADAR_RADIUS)*Sin(RADAR_ANGLE)
Ink 1,0 Ink 1,0
Draw RADAR_CX,RADAR_CY To RADAR_CX-RADAR_HAND_X,RADAR_CY-RADAR_HAND_Y Draw RADAR_CX,RADAR_CY To RADAR_CX-RADAR_HAND_X,RADAR_CY-RADAR_HAND_Y
End Proc End Proc
' *** The Text Module ' *** The Text Module
TXT_PEN_BASE=13 TXT_PEN_BASE=13
TXT_PEN_SPECIAL=1 TXT_PEN_SPECIAL=1
Dim TXT_SPECIAL_STRINGS$(4) Dim TXT_SPECIAL_STRINGS$(4)
TXT_SPECIAL_STRINGS$(0)="Basia" TXT_SPECIAL_STRINGS$(0)="Basia"
TXT_SPECIAL_STRINGS$(1)="Ziomek" TXT_SPECIAL_STRINGS$(1)="Ziomek"
TXT_SPECIAL_STRINGS$(2)="Tomek" TXT_SPECIAL_STRINGS$(2)="Tomek"
TXT_SPECIAL_STRINGS$(3)="Pecia" TXT_SPECIAL_STRINGS$(3)="Pecia"
Dim TXT_SPECIAL_STRING_COORDS(4,2) Dim TXT_SPECIAL_STRING_COORDS(4,2)
Global TXT_PEN_BASE,TXT_PEN_SPECIAL,TXT_SPECIAL_STRINGS$(),TXT_SPECIAL_STRING_COORDS() Global TXT_PEN_BASE,TXT_PEN_SPECIAL,TXT_SPECIAL_STRINGS$(),TXT_SPECIAL_STRING_COORDS()
Procedure TXT_INIT Procedure TXT_INIT
Randomize Timer Randomize Timer
For Y=1 To 23 For Y=1 To 23
For X=1 To 38 For X=1 To 38
Pen TXT_PEN_BASE Pen TXT_PEN_BASE
Locate X,Y : Print Chr$(32+Rnd(64)); Locate X,Y : Print Chr$(32+Rnd(64));
Next X Next X
Next Y Next Y
For I=0 To 3 For I=0 To 3
TXT_SPECIAL_STRING$=TXT_SPECIAL_STRINGS$(I) TXT_SPECIAL_STRING$=TXT_SPECIAL_STRINGS$(I)
TXT_SPECIAL_STRING_COORDS(I,0)=1+Rnd(37-Len(TXT_SPECIAL_STRING$)) TXT_SPECIAL_STRING_COORDS(I,0)=1+Rnd(37-Len(TXT_SPECIAL_STRING$))
TXT_SPECIAL_STRING_COORDS(I,1)=1+Rnd(23) TXT_SPECIAL_STRING_COORDS(I,1)=1+Rnd(22)
Next I Next I
End Proc End Proc
Procedure TXT_TICK Procedure TXT_TICK
Randomize Timer Randomize Timer
TXT_HIGHLIGHT_COUNT=Rnd(50) TXT_HIGHLIGHT_COUNT=Rnd(50)
For I=0 To TXT_HIGHLIGHT_COUNT For I=0 To TXT_HIGHLIGHT_COUNT
TXT_HIGHLIGHT_X=1+Rnd(37) TXT_HIGHLIGHT_X=1+Rnd(37)
TXT_HIGHLIGHT_Y=1+Rnd(22) TXT_HIGHLIGHT_Y=1+Rnd(22)
TXT_HIGHLIGHT_PEN=4+Rnd(11) TXT_HIGHLIGHT_PEN=4+Rnd(11)
Locate TXT_HIGHLIGHT_X,TXT_HIGHLIGHT_Y Locate TXT_HIGHLIGHT_X,TXT_HIGHLIGHT_Y
Pen TXT_HIGHLIGHT_PEN : Paper 0 Pen TXT_HIGHLIGHT_PEN : Paper 0
Print Chr$(32+Rnd(64)); Print Chr$(32+Rnd(64));
Next I Next I
For I=0 To 3 For I=0 To 3
Pen TXT_PEN_SPECIAL : Paper 0 Pen TXT_PEN_SPECIAL : Paper 0
Locate TXT_SPECIAL_STRING_COORDS(I,0),TXT_SPECIAL_STRING_COORDS(I,1) Locate TXT_SPECIAL_STRING_COORDS(I,0),TXT_SPECIAL_STRING_COORDS(I,1)
Print TXT_SPECIAL_STRINGS$(I); Print TXT_SPECIAL_STRINGS$(I);
Next I Next I
End Proc End Proc
' *** The Main Loop ' *** The Main Loop
CURRENT_MOD=0 CURRENT_MOD=0
CURRENT_MOD_MAX_TIME=250 CURRENT_MOD_MAX_TIME=250
LOCK_CURRENT_MOD=False LOCK_CURRENT_MOD=False
Global CURRENT_MOD Global CURRENT_MOD
Procedure CURRENT_MOD_INIT Procedure CURRENT_MOD_INIT
Screen 2 Screen 2
MAIN_DRAW_BORDER MAIN_DRAW_BORDER
If CURRENT_MOD=1 If CURRENT_MOD=1
RADAR_INIT RADAR_INIT
Else If CURRENT_MOD=2 Else If CURRENT_MOD=2
TXT_INIT TXT_INIT
End If End If
Screen Copy 2 To 1 Screen Copy 2 To 1
End Proc End Proc
CURRENT_MOD_INIT CURRENT_MOD_INIT
CURRENT_MOD_START=Timer CURRENT_MOD_START=Timer
Do Do
CURRENT_MOD_TIME=Timer-CURRENT_MOD_START CURRENT_MOD_TIME=Timer-CURRENT_MOD_START
If LOCK_CURRENT_MOD=False and CURRENT_MOD_TIME>=CURRENT_MOD_MAX_TIME If LOCK_CURRENT_MOD=False and CURRENT_MOD_TIME>=CURRENT_MOD_MAX_TIME
CURRENT_MOD=CURRENT_MOD+1 CURRENT_MOD=CURRENT_MOD+1
If CURRENT_MOD>2 If CURRENT_MOD>2
CURRENT_MOD=0 CURRENT_MOD=0
End If End If
CURRENT_MOD_START=Timer CURRENT_MOD_START=Timer
CURRENT_MOD_INIT CURRENT_MOD_INIT
End If End If
Screen 1 Screen 1
If CURRENT_MOD=0 If CURRENT_MOD=0
RECT_TICK RECT_TICK
Else If CURRENT_MOD=1 Else If CURRENT_MOD=1
RADAR_TICK RADAR_TICK
Else If CURRENT_MOD=2 Else If CURRENT_MOD=2
TXT_TICK TXT_TICK
End If End If
Screen Copy 1 To 0 Screen Copy 1 To 0
View View
Wait Vbl Wait Vbl
If Mouse Click<>0 or Key State(69)=True If Mouse Click<>0 or Key State(69)=True
Exit Exit
End If End If
Loop Loop

BIN
ScreenSaver/ScreenSaver.adf Normal file → Executable file

Binary file not shown.

BIN
ScreenSaver/ScreenSaver.exe Normal file → Executable file

Binary file not shown.