The_Muh aka Mark Aroni

Anmeldungsdatum: 11.09.2006 Beiträge: 718
|
Verfasst am: 06.10.2008, 00:29 Titel: GFX_modus wird beendet |
|
|
Problem:
Der GFX-Modus wird beendet, aber der prozess des programms läuft weiter... (obwohl das meiste grafik-befehle sind).
Hier der code... der wahrscheinlich von fehlern nur so wimmelt... zu meiner entschuldigung: die Mutexlock- und unlocks vor und nach den grafik-befehlen sind bei der suche nach dem fehler dazugekommen... und das ganze ist eh nur eins meiner Langeweile-Codes...
Code: | screenres 1024, 756 ,,,&H01
type pixel
x(1 to 75) as integer
y(1 to 75) as integer
end type
dim shared ID as integer
dim shared new_round as integer
dim shared term as integer
dim shared clean as integer
dim shared xm as any ptr
xm = mutexcreate
SETMOUSE 1,1,0
randomize timer
function rancol(zahl as integer= 15) as integer
dim x as integer
dim col as integer
x = rnd*zahl +1
col = x
select case x
case 4
col = rnd*4+1
case 8
col = rnd*4+1
case 7
col = rnd*5+9
end select
return col
end function
sub watch()
dim key as string
dim mx as integer
dim my as integer
dim new_x as integer
dim new_y as integer
getmouse my, mx
do
draw string (1,1),str( clean)
sleep 10
draw string (1,1),chr(219) + chr(219),0
getmouse new_y, new_x
if new_x <> mx then exit do
if new_y <> my then exit do
key = inkey
loop until key <> "" or new_y <> my or new_x <> mx
mutexlock(XM)
end
mutexunlock(XM)
end sub
sub text()
do
draw string (51*8 , 39*8),"# # ##### ##### ##### # #"
draw string (51*8 , 40*8),"# # # # # # # # # #"
draw string (51*8 , 41*8),"##### ##### ##### ##### #"
draw string (51*8 , 42*8),"# # # # # # #"
draw string (51*8 , 43*8),"# # # # # # #"
draw string (55*8 , 45*8),"# # ##### # #"
draw string (55*8 , 46*8),"## # # # #"
draw string (55*8 , 47*8),"# # # ##### # # #"
draw string (55*8 , 48*8),"# ## # ## ##"
draw string (55*8 , 49*8),"# # ##### # #"
draw string (52*8 , 51*8),"# # ##### ##### #### "
draw string (52*8 , 52*8)," # # # # # # #"
draw string (52*8 , 53*8)," # ##### ##### ####"
draw string (52*8 , 54*8)," # # # # # #"
draw string (52*8 , 55*8)," # ##### # # # #"
sleep 2500
loop
end sub
sub del_pix(p as pixel)
for i as integer = 1 to 75
mutexlock(XM)
pset(p.x(i), p.y(i)),0
mutexunlock(XM)
sleep 10
next
end sub
sub feuerwerk()
dim x as integer
dim boden as integer
dim y as integer
dim col as integer
dim p as pixel
do
col = rancol(15)
x = rnd * 923 + 50
y = rnd * 656 + 50
boden = x + rnd*50 - rnd*50
for i2 as integer = 756 to y step -1
mutexlock(XM)
circle (x, i2 +1), 1.5,0,,,,f
circle (x, i2), 1.5,col,,,,f
mutexunlock(XM)
sleep 1
next i2
circle (x, y), 1.5,0,,,,f
for i2 as integer = 1 to 75
mutexlock(XM)
p.x(i2) = (rnd*i2 +1 - i2/2) + x
p.y(i2) = (rnd*i2 +1 - i2/2) + y
pset(p.x(i2), p.y(i2)),col
mutexunlock(XM)
sleep 10
next i2
locate 1,1 : print col
del_pix(p)
sleep 1
loop
end sub
dim feuer(1 to 6) as any ptr
Dim TH1 as Any Ptr = ThreadCreate(Cast(Any Ptr, @watch))
Dim TH2 as Any Ptr = ThreadCreate(Cast(Any Ptr, @text))
for i as integer = 1 to 6
feuer(i) = threadcreate(cast(any ptr, @feuerwerk))
sleep rnd*(i * 20 * (rnd*100)) +1
next i
|
bitte um hilfe... und verzeiht mir das automatische erstellen der threads xD _________________ // nicht mehr aktiv // |
|