BB2D 3D Achterbahn.

Übersicht BlitzBasic Codearchiv

Neue Antwort erstellen

Kabelbinder

Sieger des WM-Contest 2006

Betreff: BB2D 3D Achterbahn.

BeitragMo, Aug 29, 2005 16:24
Antworten mit Zitat
Benutzer-Profile anzeigen
Hi

Mir ist heute im Matheunterricht so ne Ideegekommen, als wir über Funktionen gesprochen haben. Hat auch so geklapp, wie ich mir das vorgestellt hab Very Happy .

Vielleicht kann man dauraus so ne Art Rennspiel machen Confused .

hier der Code:
Code: [AUSKLAPPEN]
AppTitle "Graph Racer"
Graphics 640,480,16,2
SetBuffer BackBuffer()
SeedRnd MilliSecs()

Global bend#,dir#,stat,scroll,brace,control,mx,my

bend = -0.25
scroll = 0
stat = 0
dir = 0
brace = 1

MoveMouse 320,240
Repeat
mx = MouseX()
my = MouseY()
If KeyHit(57)=1 Then
brace = Not brace
EndIf

;autosteuerung
bend = bend - 0.01 * (Sgn(dir)*(Abs(dir)/5))
scroll = scroll + 5 * (Sgn(dir)*(Abs(dir)/5))

;maussteuerung
;control = MouseXSpeed()
;bend = bend - 0.01 * (Sgn(control)*(Abs(control)/5))
;scroll = scroll + 5 * (Sgn(control)*(Abs(control)/5))

dir = dir + Rand(-1,1)
dir = dir + bend/4
dir = dir * 0.98

If stat >= 20 Then
stat = 0
Else
stat = stat + 2
EndIf

Color 0,255,0
For i = 0 To 440
Plot 320+i*bend+scroll,40+(i^2)/400
Plot 320+i*(bend+0.5)+scroll,40+(i^2)/400

If i Mod 20 = 0 Then
Line 320+(i+stat)*bend+scroll,40+((i+stat)^2)/400,320+(i+stat)*(bend+0.5)+scroll,40+((i+stat)^2)/400

If brace = 1 Then
If bend > 0 Then
Rect 320+(i+stat)*bend+scroll,40+((i+stat)^2)/400,1,500
EndIf
If bend < -0.5 Then
Rect 320+(i+stat)*(bend+0.5)+scroll,40+((i+stat)^2)/400,1,500
EndIf
EndIf

EndIf

Next
Color 255,255,255
Text 0,0,bend,0,0
Text 0,10,scroll,0,0
Text 0,20,dir,0,0
Text 0,30,Str$(Abs(dir)/5),0,0

Color 255,0,0
Text 400,0,"Leertaste: Stützen ausblenden"

Flip
Cls
Until KeyHit(1)
End


thx for reading
cu
<Wing Avenger Download> ◊◊◊ <Macrophage Download>

theotheoderich

BeitragDi, Aug 30, 2005 7:48
Antworten mit Zitat
Benutzer-Profile anzeigen
Das ist ja spassig, erinnert irgendwie an Stund-Car-Racer auf dem C64 Very Happy
Gruß
TheoTheoderich
--
The box label said, "Requires Windows XP or better.", so I bought an Amiga Computer.
 

TOONY

BeitragDi, Sep 13, 2005 21:02
Antworten mit Zitat
Benutzer-Profile anzeigen
ist interessant, aber eine achterbahn seh ich da nicht

Kabelbinder

Sieger des WM-Contest 2006

BeitragDo, Sep 15, 2005 21:06
Antworten mit Zitat
Benutzer-Profile anzeigen
Ja, stimmt eigentlich. Ich hab's im Nachhinein so genannt, damit sich's mehr Leute ansehen Very Happy .
<Wing Avenger Download> ◊◊◊ <Macrophage Download>

Neue Antwort erstellen


Übersicht BlitzBasic Codearchiv

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group