noniin, nyt on sitten tehty ensimmäistä koodia, tein tuon skinkkenin kentän, ja se toimii hyvin (paitsi että kun pääsee läpi, se sanoo että olisit kuollut...). No, voitte testata omia kenttiänne, ilman objecteja tosin (ellette jaksa koodata lisää...)
Kertokaa myös, mitä pidätte 'fysiikoista', niitä kun voi muokata aika lailla
no, tässä tämä:
Code: Select all
Screen 640,480
D7_hit=loadimage("hit.png")
D7_lvl=loadimage("level.png")
D7_obj1=loadimage("junttari.png")
maskimage D7_obj1, 255,0,255
'maskimage D7_hit, 255,0,255
obj1y=3
obj2y=-160
obj1m=1
obj2m=1
x#=40
y#=320
startx=x
starty=y
xplus#=0
yplus#=0
repeat
if obj1m=1 then gosub nosta
if obj1m=0 then gosub tiputa
if obj2m=1 then gosub nosta2
if obj2m=0 then gosub tiputa2
drawimage D7_hit,0,0
drawimage D7_obj1,112,obj1y
drawimage D7_obj1,237,obj2y
pix=Getpixel(x,y)
text 0,0,""+pix
if pix<>-65281 then
drawimage D7_lvl,0,0
print "kuolit"
wait 1000
x=startx
y=starty
xplus#=0
yplus#=0
endif
drawimage D7_lvl,0,0
drawimage D7_obj1,112,obj1y
drawimage D7_obj1,237,obj2y
circle x-5,y-5,10,0
yplus-0.02
y-yplus
x-xplus
xplus=curvevalue(0,xplus,20.0)
if upkey() or keydown(17) then yplus+0.2
if downkey() or keydown(31) then yplus-0.2
if leftkey() or keydown(30) then xplus+0.2
if rightkey() or keydown(32) then xplus-0.2
drawscreen
forever
nosta:
if obj1y>-319 then
obj1y-4
else
obj1m=0
endif
return
tiputa:
if obj1y<4 then
obj1y+20
else
obj1m=1
endif
return
nosta2:
if obj2y>-319 then
obj2y-4
else
obj2m=0
endif
return
tiputa2:
if obj2y<4 then
obj2y+20
else
obj2m=1
endif
return