Author Topic: Sine  (Read 2090 times)

Cosmo

  • Guest
Sine
« on: June 19, 2013, 02:02:46 PM »
Hi,

A bit music?
Code: [Select]
import "speed.lib"
import "library.lib"

set window 320,240,640,540
create font 0, "verdana",38
set redraw off

visible:
winkel#[60]; y#[60]; r1#=10.0; x; c; abc$; mig
txt$ ="OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO"
TextL = len(txt)

for x=0 to TextL
winkel[x] =320.0 - float(x)*(360.0/float(TextL))
y[x] =240.0
next

load music 1,"music/b.mod"
play music 1

while not keydown(27)
proc ClsColor 0,0,0
for x=0 to 40
   for c=0 to 33
      proc Rect x*16,c*16,16,16,254,190,0
   next
next
for x=1 to TextL
   winkel[x] = winkel[x] + 1.2
   if winkel[x] =360.0 then winkel[x] = -360.0
   abc = mid(txt,x,1)
   y[x] = y[x] + sin(winkel[x]) * 2.5
   proc Text x*10,int(y[x]),abc,250,250,250

   y[x] = y[x] + cos(winkel[x]) * 1.0
   proc Text x*8,int(y[x]),abc,255,255,255

next
proc Text 160,0,"Simple Mathematics",0,255,120
redraw
proc SPD_HoldFrame 120
wend   

Mopz

  • Guest
Re: Sine
« Reply #1 on: June 19, 2013, 05:48:11 PM »
Hi,

A bit music?
Code: [Select]
import "speed.lib"
import "library.lib"

set window 320,240,640,540
create font 0, "verdana",38
set redraw off

visible:
winkel#[60]; y#[60]; r1#=10.0; x; c; abc$; mig
txt$ ="OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO"
TextL = len(txt)

for x=0 to TextL
winkel[x] =320.0 - float(x)*(360.0/float(TextL))
y[x] =240.0
next

load music 1,"music/b.mod"
play music 1

while not keydown(27)
proc ClsColor 0,0,0
for x=0 to 40
   for c=0 to 33
      proc Rect x*16,c*16,16,16,254,190,0
   next
next
for x=1 to TextL
   winkel[x] = winkel[x] + 1.2
   if winkel[x] =360.0 then winkel[x] = -360.0
   abc = mid(txt,x,1)
   y[x] = y[x] + sin(winkel[x]) * 2.5
   proc Text x*10,int(y[x]),abc,250,250,250

   y[x] = y[x] + cos(winkel[x]) * 1.0
   proc Text x*8,int(y[x]),abc,255,255,255

next
proc Text 160,0,"Simple Mathematics",0,255,120
redraw
proc SPD_HoldFrame 120
wend   

Another good one :) May I add it to the "Examples" section of naalaa.com?

Cosmo

  • Guest
Re: Sine
« Reply #2 on: June 19, 2013, 05:50:14 PM »
Quote
Another good one  May I add it to the "Examples" section of naalaa.com?

But sure.