Unbeabsichtigt Trotzdem Witzig

Übersicht BlitzBasic Codearchiv

Neue Antwort erstellen

sbrog

Betreff: Unbeabsichtigt Trotzdem Witzig

BeitragDi, Apr 06, 2004 15:08
Antworten mit Zitat
Benutzer-Profile anzeigen
Die meisten Entdeckungen (wie diese auch) werden durch Misserfolge gemacht Very Happy

Das könnte sich als Screensaver eignen:D
BlitzBasic: [AUSKLAPPEN]

; richtung 1 : oben links
; richtung 2 : oben rechts
; richtung 3 : unten rechts
;richtung 4 : unten links


Graphics 1024,768

Global y = Rand(50,718)

Global Direct = 3







ClsColor 255,0,50

Repeat



;..............................................................................................

If direct =1 Then
x = x-2
y = y-2
EndIf

If direct = 2 Then
x = x+2
y = y-2
EndIf

If Direct = 3 Then
x = x +2
y = y +2
EndIf

If direct = 4 Then
x = x-2
y = y+2
EndIf
;----------------------------------------------------------------------------------------------------

If x>989
If direct = 3
direct = 4
EndIf
EndIf

If x>989
If direct = 2
direct = 1
EndIf
EndIf

If y> 733
If direct = 3
Direct = 2
EndIf
EndIf

If y>733
If direct = 4
Direct = 1
EndIf
EndIf

If x<0
If direct = 1
Direct = 2
EndIf
EndIf

If x<0
If direct = 4
Direct = 3
EndIf
EndIf

If y<0
If direct = 1
direct = 4
EndIf
EndIf

If y<0
If direct = 2
direct = 3
EndIf
EndIf
;---------------------------------------------------------------------------------------------------
Color x,y,0
Rect x,y,50,50,2





Flip
Until KeyHit(1)



 

Hitschie

BeitragDi, Apr 06, 2004 15:15
Antworten mit Zitat
Benutzer-Profile anzeigen
Die letzen 30 Zeilen sind überflüssig Wink
Ich hab deine "Arrow Party" mal etwas optimiert.

BlitzBasic: [AUSKLAPPEN]
Graphics 800, 600, 16, 2
SetBuffer BackBuffer()
AppTitle "Arrow Party"

Global y = Rand(50,718)
Global Direct = 3

Repeat

If direct =1 Then
x = x-2
y = y-2
EndIf
If direct = 2 Then
x = x+2
y = y-2
EndIf
If Direct = 3 Then
x = x +2
y = y +2
EndIf
If direct = 4 Then
x = x-2
y = y+2
EndIf

If x>989
If direct = 3
direct = 4
EndIf
EndIf
If x>989
If direct = 2
direct = 1
EndIf
EndIf
If y> 733
If direct = 3
Direct = 2
EndIf
EndIf
If y>733
If direct = 4
Direct = 1
EndIf
EndIf
If x<0
If direct = 1
Direct = 2
EndIf
EndIf
If x<0
If direct = 4
Direct = 3
EndIf
EndIf
If y<0
If direct = 1
direct = 4
EndIf
EndIf
If y<0
If direct = 2
direct = 3
EndIf
EndIf

Color x,y,0
Rect x,y,50,50,2

Flip
Until KeyHit(1)

Suco-X

Betreff: ......

BeitragDi, Apr 06, 2004 17:34
Antworten mit Zitat
Benutzer-Profile anzeigen
Hmmm....Der Effekt lässt ein wenig zu wünschen übrig. Und den Code allgemein sollte man den Leuten nicht antuen.
bye
Intel Core 2 Quad Q8300, 4× 2500 MHz, 4096 MB DDR2-Ram, GeForce 9600GT 512 MB

Travis

BeitragDi, Apr 06, 2004 18:16
Antworten mit Zitat
Benutzer-Profile anzeigen
Es geht auch ohne 30GB Code!

BlitzBasic: [AUSKLAPPEN]

Graphics 800,600,16,2
SetBuffer BackBuffer()

w = 45
s = 1

Repeat

x = x + Cos(w) * s
y = y + Sin(w) * s

If y > 575 Then w = w + 45
If x > 775 Then w = w - 45
If y < 0 Then w = w - 45
If x < 0 Then w = w + 45

;Color x,x,y
Color x,y,0

Rect x,y,25,25,1

Delay 4

Flip 0
Until KeyHit(1)
End


PS: Was hat denn das mit Pfeilen zutun???
www.funforge.org

Ich hasse WASD-Steuerung.

Man kann alles sagen, man muss es nur vernünftig begründen können.

sbrog

BeitragDi, Apr 06, 2004 19:54
Antworten mit Zitat
Benutzer-Profile anzeigen
Ich kenn mich leider nicht mit sin und cos aus, bin erst 8. Klasse

Ist übrigens mein 1. Programm
 

Kekskiller

BeitragDi, Apr 06, 2004 21:40
Antworten mit Zitat
Benutzer-Profile anzeigen
Hihi , ich liebe diesen Knick , welcher plötzlich nach gewisser Zeit auftaucht.Soetwas ähnliche hatte ich mal mit Text gemacht , nur dass hierbei noch irgendwelche Partikel-ähnliche Zeichen um den Strahl rumschwirrten , sah sehr wild aus Mr. Green

Mangudai

BeitragMi, Apr 07, 2004 0:57
Antworten mit Zitat
Benutzer-Profile anzeigen
hallo

@ travis: wofür ist das "s" da?

lg mangudai

Xenon

BeitragMi, Apr 07, 2004 10:30
Antworten mit Zitat
Benutzer-Profile anzeigen
1.: Das s ist da, damit man die Geschwindigkeit ändern kann...
2.: Würde ich s konstant und w lokal setzen
3.: Würde ich das nicht mit Sin und Cos machen, wenns dann eh nicht stimm, änder mal den winkel w auf 30 oder so und schau was er dann für abnormale abpraller hat Laughing

Mfg Xenon

sbrog

BeitragMi, Apr 07, 2004 11:42
Antworten mit Zitat
Benutzer-Profile anzeigen
ich hab versucht die Struktur zu vereinfachen,
indem ich Functions einsetze, das klappt aber nicht so wie es sollte



BlitzBasic: [AUSKLAPPEN]
Graphics 1024,768

Global y = Rand(50,718)

Global Direct = 3







ClsColor 255,0,50

Repeat




bewegen
abprallen

Color x,y,0
Rect x,y,50,50,2

Flip
Until KeyHit(1)




Function abprallen()

If x>989
If direct = 3
direct = 4
EndIf
EndIf

If x>989
If direct = 2
direct = 1
EndIf
EndIf

If y> 733
If direct = 3
Direct = 2
EndIf
EndIf

If y>733
If direct = 4
Direct = 1
EndIf
EndIf

If x<0
If direct = 1
Direct = 2
EndIf
EndIf

If x<0
If direct = 4
Direct = 3
EndIf
EndIf

If y<0
If direct = 1
direct = 4
EndIf
EndIf

If y<0
If direct = 2
direct = 3
EndIf
EndIf
End Function

Function bewegen()
If direct =1 Then
x = x-2
y = y-2
EndIf

If direct = 2 Then
x = x+2
y = y-2
EndIf

If Direct = 3 Then
x = x +2
y = y +2
EndIf

If direct = 4 Then
x = x-2
y = y+2
EndIf
End Function
  • Zuletzt bearbeitet von sbrog am Mi, Apr 07, 2004 13:08, insgesamt einmal bearbeitet
 

Edlothiol

BeitragMi, Apr 07, 2004 11:48
Antworten mit Zitat
Benutzer-Profile anzeigen
Du hast x nicht Global deklariert.

sbrog

BeitragMi, Apr 07, 2004 13:07
Antworten mit Zitat
Benutzer-Profile anzeigen
jetzt klappts
ist die struktur jetzt einigermaßen OK ?

BlitzBasic: [AUSKLAPPEN]

Graphics 1024,768

Global y = Rand(100,300)
Global x = Rand(100,300)
Global Direct = 3



ClsColor 255,0,50

;---------------------------------------------------------------------------------------------------
Repeat

bewegen
abprallen
zeichnen


Flip
Until KeyHit(1)
;----------------------------------------------------------------------------------------------------


Function abprallen()

If x>989
If direct = 3
direct = 4
EndIf
EndIf

If x>989
If direct = 2
direct = 1
EndIf
EndIf

If y> 733
If direct = 3
Direct = 2
EndIf
EndIf

If y>733
If direct = 4
Direct = 1
EndIf
EndIf

If x<0
If direct = 1
Direct = 2
EndIf
EndIf

If x<0
If direct = 4
Direct = 3
EndIf
EndIf

If y<0
If direct = 1
direct = 4
EndIf
EndIf

If y<0
If direct = 2
direct = 3
EndIf
EndIf
End Function
;---------------------------------------------

Function bewegen()
If direct =1 Then
x = x-2
y = y-2
EndIf

If direct = 2 Then
x = x+2
y = y-2
EndIf

If Direct = 3 Then
x = x +2
y = y +2
EndIf

If direct = 4 Then
x = x-2
y = y+2
EndIf
End Function
;------------------------------------------------
Function zeichnen()
Color x,y,0
Rect x,y,50,50,2
End Function
 

Edlothiol

BeitragMi, Apr 07, 2004 15:11
Antworten mit Zitat
Benutzer-Profile anzeigen
BlitzBasic: [AUSKLAPPEN]
If y<0
If direct = 1
direct = 4
EndIf
EndIf

If y<0
If direct = 2
direct = 3
EndIf
EndIf
*würg*

sbrog

BeitragMi, Apr 07, 2004 15:41
Antworten mit Zitat
Benutzer-Profile anzeigen
aha .
Interessante Aussage.
Was bedeutet die ?

Travis

BeitragMi, Apr 07, 2004 16:18
Antworten mit Zitat
Benutzer-Profile anzeigen
@ Xenon
Very Happy Deswegen habe ich ja 45° genommen. Ich mache mir doch nicht die Mühe und programmiere für sowas 'ne Mega-Turbo-Physikalische-Abprall-Engine-mit-Erdbeschleunigungs-und-Reibungswiderstands-Berücksichtigung.

@sbrog
Muss das so flimmern... Rolling Eyes
www.funforge.org

Ich hasse WASD-Steuerung.

Man kann alles sagen, man muss es nur vernünftig begründen können.

Xenon

BeitragMi, Apr 07, 2004 17:21
Antworten mit Zitat
Benutzer-Profile anzeigen
wtf?

einfallswinkel = ausfallswinkel... das hat man in 3 zeilen... maximal...

Neue Antwort erstellen


Übersicht BlitzBasic Codearchiv

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group