Sinus Frage.
Übersicht

dada11Betreff: Sinus Frage. |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Ich habe mal so auf die schnelle ein PNG mit 1000 Px Breite und 1 Px Höhe gemacht und das möchte ich jetzt mit der SIN Funktion hin und her fahren lasse. Das ganze mache ich in 180 Zeilen. Klappt auch prima, die 180 Zeilen scrollen fein von Links nach Rechts und zurück. Jetzt meine Frage, wie muß ich den Code verändern damit die nicht immer alle gleich hin hund her Scrollen sondern versetzt so das eine Welle entsteht ?
Greetz Dada11 Graphics 800,600 HideMouse () '# '# Variabeln '# Incbin "colorline.png" Global bob = LoadImage ("incbin::colorline.png") MidHandleImage bob Global x_wert=Int 0 Global linecount=180 Global line=0 '# '# Hauptschleife '# Repeat Cls '# '# Draw The Line '# For x = 0 Until linecount DrawImage bob,400 + Sin(x_wert) * 100,line line:+1 Next line=0 x_wert:-3 If x_wert > 0 Then x_wert = 850 Flip Until KeyHit(KEY_ESCAPE) End |
||
![]() |
Markus2 |
![]() Antworten mit Zitat ![]() |
---|---|---|
so ?
Code: [AUSKLAPPEN] Graphics 800,600 Global bob =LoadImage ("C:\Dokumente und Einstellungen\Gang\Desktop\Kugel.bmp") MidHandleImage bob Global x_wert=Int 0 Global linecount=180 Global line=0 Global w:Float Repeat Cls SetColor 255,255,255 For x = 0 Until linecount DrawImage bob,400 + Sin(x_wert) * 100 +Sin(w)*50.0 ,line line:+1 w=w+2.1;If w>360 Then w=w-360 Next line=0 x_wert:-3 If x_wert > 0 Then x_wert = 850 Flip Until KeyHit(KEY_ESCAPE) End |
||
dada11 |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Schon nicht schlecht, dachte aber mehr an sowas hier. Das ist schon das was ich wollte, muß jetzt nur versuchen das auf 180 Zeilen zubekommen. Irgendwie sind das wenige ?!?
Graphics 800,600 HideMouse () '# '# Variabeln Bilder laden usw BOB '# Incbin "colorline.png" Global bob = LoadImage ("incbin::colorline.png") MidHandleImage bob Global x_wert=0 Global xadder=0 Global yadder=0 '# '# Hauptschleife '# Repeat Cls '# '# Draw The Bob Move '# For x = 0 To 180 DrawImage bob,400 + Sin(x_wert+xadder) * 100,400+Sin(yadder)*50 xadder:+3 yadder:+1 If yadder > 180 Then yadder = 0 Next xadder=0 yadder=0 x_wert:-1 If x_wert = 0 Then x_wert = 850 Flip Until KeyHit(KEY_ESCAPE) End |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group