nachdem ich einige Zeit kein PB mehr programmiert habe (großes BB Projekt gehabt), wollte ich mich heute mal wieder ein wenig einüben und hab ein paar nette Plot und Line Sachen erstellt, ziehts euch einfach rein ich hoffe ihr habt wenigstens bisl Spass dabei! Es handelt sich übrigens um 9 Beispiele was man mit Plot/Line und Box alles machen kann, ihr braucht nur den Code.
MfG satzzeichen
EDIT:Habe den aktuellsten Code gleich hier editet, damit ihr nicht alle Posts absuchen müsst.
Code: Alles auswählen
;-----INIT PART-----;
InitSprite()
InitKeyboard()
OpenScreen(640,480,16,"Graphic Games")
var_y.l = 0
var_x.f = 0
;-----SIMULATOR BEGINS-----;
Repeat
ClearScreen(0,0,0)
StartDrawing(ScreenOutput())
FrontColor(255,0,0)
Locate(5, 0)
DrawText("Die angezeigte Taste gedrückt halten um den Effekt zu sehen!(ESC zum beenden)")
Locate(5, 25)
DrawText("1.Augenkrebs (langsam)")
Locate(5, 50)
DrawText("2.Augenkrebs (klein)")
Locate(5, 75)
DrawText("3.Augenkrebs (mittel) II")
Locate(5, 100)
DrawText("4.Augenkrebs (groß) III")
Locate(5, 125)
DrawText("5.Augenkrebs (sehr groß) IV")
Locate(5, 150)
DrawText("6.Pfeil I")
Locate(5, 175)
DrawText("7.Pfeil (getrennt) II")
Locate(5, 200)
DrawText("8.Pentagramm I")
Locate(5, 225)
DrawText("9.Pentagramm (leuchtend) II")
Locate(5, 250)
DrawText("0.Pentagramm (besser) III")
Locate(5, 400)
DrawText("Es können auch 2 Effekte übereinander gelegt werden...")
LineXY(200,150,521,150)
LineXY(200,351,521,351)
LineXY(200,150,200,350)
LineXY(521,150,521,350)
;Beispiel 1 und 2 sind identisch, allerdings soll Beispiel 2 verdeutlichen,
;wie man es nicht machen sollte :).
ExamineKeyboard()
If KeyboardPushed(#PB_Key_1)
For y = 0 To 199
For x = 0 To 319
FrontColor(Random(255),Random(255),Random(255))
Plot(x+201,y+151)
Next
Next
EndIf
If KeyboardPushed(#PB_Key_2)
For y = 0 To 199
For x = 0 To 319
Plot(x+201,y+151,RGB(Random(255),Random(255),Random(255)))
Next
Next
EndIf
If KeyboardPushed(#PB_Key_3)
For y = 0 To 19
For x = 0 To 31
Box(x*10+201,y*10+151,10,10,RGB(Random(255),Random(255),Random(255)))
Next
Next
EndIf
If KeyboardPushed(#PB_Key_4)
Box(201,151,160,100,RGB(Random(255),Random(255),Random(255)))
Box(361,151,160,100,RGB(Random(255),Random(255),Random(255)))
Box(201,251,160,100,RGB(Random(255),Random(255),Random(255)))
Box(361,251,160,100,RGB(Random(255),Random(255),Random(255)))
EndIf
If KeyboardPushed(#PB_Key_5)
Box(201,151,320,200,RGB(Random(255),Random(255),Random(255)))
EndIf
If KeyboardPushed(#PB_Key_6)
For anzahl = 1 To 150
var_y.l = 0
For x = -20 To 20
Plot(anzahl+x+291,var_y+201,RGB(Random(255),Random(255),Random(255)))
var_y.l = var_y.l + 1
Next
var_y.l = 0
For x = -20 To 20
Plot(anzahl+x+291,var_y+281,RGB(Random(255),Random(255),Random(255)))
var_y.l = var_y.l - 1
Next
Next
EndIf
If KeyboardPushed(#PB_Key_7)
For anzahl = 1 To 15
var_y.l = 0
For x = -20 To 20
Plot(anzahl*10+x+291,var_y+201,RGB(Random(255),Random(255),Random(255)))
var_y.l = var_y.l + 1
Next
var_y.l = 0
For x = -20 To 20
Plot(anzahl*10+x+291,var_y+281,RGB(Random(255),Random(255),Random(255)))
var_y.l = var_y.l - 1
Next
Next
EndIf
If KeyboardPushed(#PB_Key_8)
FrontColor(255,255,255)
LineXY(360,175,310,325)
LineXY(360,175,410,325)
LineXY(285,225,435,225)
LineXY(285,225,410,325)
LineXY(435,225,310,325)
EndIf
If KeyboardPushed(#PB_Key_9)
LineXY(360,175,310,325,RGB(Random(255),Random(55),Random(55)))
LineXY(360,175,410,325,RGB(Random(255),Random(55),Random(55)))
LineXY(285,225,435,225,RGB(Random(255),Random(55),Random(55)))
LineXY(285,225,410,325,RGB(Random(255),Random(55),Random(55)))
LineXY(435,225,310,325,RGB(Random(255),Random(55),Random(55)))
EndIf
If KeyboardPushed(#PB_Key_0)
For x = 1 To 150
Plot(285+x,225,RGB(Random(255),Random(55),Random(55)))
Next
For x = 1 To 150
Plot(360-(x*0.3391),175+x,RGB(Random(255),Random(55),Random(55)))
Next
For x = 1 To 150
Plot(360+(x*0.3391),175+x,RGB(Random(255),Random(55),Random(55)))
Next
For x = 1 To 150
Plot(285+(x*0.838),225+(x*0.675),RGB(Random(255),Random(55),Random(55)))
Next
For x = 1 To 150
Plot(435-(x*0.838),225+(x*0.675),RGB(Random(255),Random(55),Random(55)))
Next
EndIf
StopDrawing()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
;-----END-----;