It's time for retro ...
set display mode 800, 600, 32, 1
color backdrop 0 : hide mouse
type trun x, y#, a, p, d endtype
global run as trun
ReadFiles()
PlayMusic()
repeat
Wobbler()
Scroller()
until mouseclick()
StopMusic()
end
function PlayMusic()
load dll "bass.dll", 1
call dll 1, "BASSMOD_Init", -1, 44100, 0
call dll 1, "BASSMOD_MusicLoad", 0, "muke.xm", -1, 0, 0x0416
call dll 1, "BASSMOD_MusicSetAmplify", 100
call dll 1, "BASSMOD_MusicPlay"
endfunction
function StopMusic()
call dll 1, "BASSMOD_Free"
delete dll 1
endfunction
function Wobbler()
s = 128
o = 100
if not run.p
cls : restore font
load bitmap "font.png", 1
for y = 0 to 5
read d$
for x = 0 to 9
a = asc(mid$(d$, x + 1))
get image a, x * s, y * s, (x + 1) * s, (y + 1) * s
next x
next y
delete bitmap 1
load bitmap "back.jpg", 1
for i = 0 to 599
get image i + o, 0, i, 800, i + 1
set sprite i + o, 1, 1
next i
delete bitmap 1
create bitmap 1, 128 * 6, 128 * 12
for y = 0 to 11
read d$
for x = 0 to 5
a = asc(mid$(d$, x + 1))
paste image a, x * s, y * s
next x
next y
get image 700, 0, 0, 128 * 6, 128 * 12
delete bitmap 1
x = 200
y = -600
repeat
for i = 0 to 599
sprite i + o, sin(a + i) * x, y + i, i + o
next i
if y < 0
inc y
inc a, 2
else
inc a
dec x, 2
endif
until x = 0
else
p = call dll(1, "BASSMOD_MusicGetPosition") and 0xffff
if p = 51 then run.d = 1
for i = 0 to 599
sprite i + o, sin(run.a + i) * run.x, i, i + o
next i
inc run.a
run.x = run.x + run.d
if run.x <= -200 then run.d = 1
if run.x >= 200 then run.d = -1
endif
font:
data "_!'#$%&`()"
data "*+,-./0123"
data "456789:;<="
data ">?@ABCDEFG"
data "HIJKLMNOPQ"
data "RSTUVWXYZ "
data "80`S "
data " INTRO"
data " "
data " "
data "CODE: "
data " KULLE"
data " "
data "GFX: "
data "GEECEE"
data " "
data "MUSIC:"
data " LAMB"
endfunction
function Scroller()
if not run.p
global t$ : read t$
sprite 700, 128, 600, 700
scale sprite 700, 75
set sprite alpha 700, 192
for s = 1 to 11
set sprite s, 1, 1
offset sprite s, 64, 0
set sprite diffuse s, 128, 128, 255
set sprite alpha s, 192
sprite s, 800 + s * 128, 490, asc( mid$(t$, s))
next s
run.p = s
run.y# = 600.0
endif
for s = 1 to 11
x = sprite x(s)
y = sprite y(s)
a = sprite angle(s)
i = sprite image(s)
if x > 110 and x < 201
dec x, 1
dec y, 1
inc a, 1
else
if x > 110
dec x, 2
else
dec y, 2
endif
endif
if y < -128
x = 896
y = 490
a = 0
if mid$(t$, run.p) = "" then run.p = 1 : read t$
if t$ = "EOS" then restore txt : read t$
i = asc(mid$(t$, run.p))
inc run.p
endif
sprite s, x, y, i
rotate sprite s, a
sprite 700, 192, run.y#, 700
run.y# = run.y# - 0.05
if run.y# < 0 - 12 * 128 then run.y# = 600.0
next s
txt:
data " *** DAS IST MEIN BEITRAG ZUM THEMA '80ER JAHRE INTRO'"
data " *** @VALLE: KLASSE SCROLLY! DU BIST EINFACH DER 2D GOTT"
data " *** GRUESSE AN DAS GANZE DB-FORUM *** ", "EOS"
endfunction
function ReadFiles()
load dll "wininet.dll", 1
call dll 1, "InternetAttemptConnect", 0
make memblock 1, 300000
buffer = get memblock ptr(1)
size = make memory(4)
inet = call dll(1, "InternetOpenA", "media", 0, "", "", 0)
restore filedata
print "Loading Media from Internet ..."
print
do
read a$, n$
if a$ = "EOF" then exit
print " - Loading " + n$;
url = call dll(1, "InternetOpenUrlA", inet, a$, "", 0, 0, 0)
call dll 1, "InternetReadFile", url, buffer, 300000, size
call dll 1, "InternetCloseHandle", url
if file exist(n$) then delete file n$
open to write 1, n$
s = *size
print " Size: ", s, " bytes";
for i = 0 to s - 1
write byte 1, memblock byte(1, i)
next i
print " >> OK <<"
close file 1
loop
call dll 1, "InternetCloseHandle", inet
delete memory size
delete memblock 1
delete dll 1
print
print "Press a key ..."
wait key
filedata:
data "http://picload.org/image/e4ec57e8508c5c4040383ebe6d367928/bass.jpg"
data "bass.dll"
data "http://picload.org/image/aac90af67862cbd6ce9844fc8f9999ee/muke.jpg"
data "muke.xm"
data "http://picload.org/image/f2b2820de9a540e2eb4515f76335b8ee/font.png"
data "font.png"
data "http://picload.org/image/69fa74756f208b45fe1cc1a223b86b1b/back.jpg"
data "back.jpg"
data "EOF"
endfunction