Author Topic: a little starfield with Types  (Read 2280 times)

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5077
  • O Rly?
    • View Profile
a little starfield with Types
« on: 2007-Apr-06 »
Code: (glbasic) [Select]
SYSTEMPOINTER TRUE
SETSCREEN 640,480,1

TYPE star
x
y
ENDTYPE

LOCAL S AS star

LOCAL stars[] AS  star

WHILE TRUE

starX = RND(640)

S.x = starX
S.y = -10

DIMPUSH stars[], S


FOREACH check IN stars[]
INC  check.y,RND(3)
SETPIXEL check.x, check.y, RGB(RND(255),RND(255),RND(255))
         IF check.y > 480 THEN DELETE check
NEXT


SHOWSCREEN
WEND
END
I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard