RND Problem
Übersicht

![]() |
LeroyBetreff: RND Problem |
![]() Antworten mit Zitat ![]() |
---|---|---|
Hallo,
ich habe ein Problem mit dem Befehl Code: [AUSKLAPPEN] Rand ...
Aus irgendeinem Grund werden alle Punkte im Code immer auf der gleichen y Position erstellt. Aber eigentlich will ich das auch diese wie bei x auf dem ganzen Bildschirm liegen und nicht alle in einer Reihe? Hier mal mein Code: Code: [AUSKLAPPEN] Graphics 800,600,0
SeedRnd MilliSecs() Type objekt Global list:TList = New TList Field objekt_x Field objekt_Y Field objekt_color1 Field objekt_color2 Field objekt_color3 EndType Repeat Flip 1 Cls If anzahl < 6 Then info:objekt = New objekt info.objekt_x = Rand(0,800) info.objekt_y = Rand(20,600) info.objekt_color1 = Rand(0,255) info.objekt_color2 = Rand(0,255) info.objekt_color3 = Rand(0,255) ListAddLast objekt.list, info anzahl = anzahl + 1 End If For i:objekt = EachIn objekt.list SetColor i.objekt_color1,i.objekt_color2,i.objekt_color3 DrawRect i.objekt_x, info.objekt_y, 5, 5 Next If KeyHit (KEY_R) Then anzahl = 0 objekt.list.Clear End If If KeyHit (KEY_D) Then objekt.list.Remove(i) End If Until KeyHit(KEY_ESCAPE) End |
||
![]() |
simi |
![]() Antworten mit Zitat ![]() |
---|---|---|
Code: [AUSKLAPPEN] For i:objekt = EachIn objekt.list
SetColor i.objekt_color1,i.objekt_color2,i.objekt_color3 DrawRect i.objekt_x, info.objekt_y, 5, 5 Next Für die y-position nimmst du bei allen objekten die position des zulets erstellten objekts.... |
||
Dreamora |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
BM Code der weder Strict noch SuperStrict nutzt ist nicht akzeptabel (weil die Sprache dann gewisse Dinge deaktiviert die man für gescheites programmieren braucht wie Variablen Scopes) | ||
Ihr findet die aktuellen Projekte unter Gayasoft und könnt mich unter @gayasoft auf Twitter erreichen. |
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group