عن اللعبة
The context behind this is I wanted to make a game in 100 lines of code or less in Pico-8. Was fun if a little tedious, mostly near the end of the project. Audio and sprites were allowed for my self-assigned rules, and direct downloads are at the bottom of the page under the sourcecode. This was originally somewhat related to the Pico-1k Challenge but I figured I didn't quite like it, hence went my own route and just did it in "Under a hundred lines of code" (The code overlaps on itself sometimes so I barely even qualify for that lol)Yeah some bits of it got stacked (such as in the draw function) and I didn't want to stack them but I was pretty short on options. Either way, hope you enjoy! Sourcecode: --apple catch, by atacomans. function _init() pt={px=60,py=104,ps=0,pw=8,ph=6,pl=3} --player table at={aptime=30} ht={hotime=60} end function appledrop() --this drops the apples add(at,{x=rnd(120),y=8,s=1.5,w=6,h=6,xs,ys,xd,yd,life=120, ad=function(self) spr(1,self.x,self.y) end, uad=function(self) self.y+=self.s --this is the colition code below. if the xd is lower than the xs (same with yd & yx) then they are considered to be colliding self.xs=pt.pw*0.5+self.w*0.5 self.ys=pt.ph*0.5+self.h*0.5 self.xd=abs((pt.px+(pt.pw/2))-(self.x+(self.w/2))) self.yd=abs((pt.py+(pt.ph/2))-(self.y+(self.h/2))) if self.xd 120 then pt.px-=2 end if pt.px<0 then pt.px+=2 end at.aptime-=1 --this decreases until it hits zero, new apple spawned, timer reset if at.aptime<1 then appledrop() at.aptime=60 end for a in all(at) do a:uad() end ht.hotime-=1 --this drops dangerous stuff on the player if ht.hotime<1 then hostiledrop() ht.hotime=60 end for h in all(ht) do h:uhd() end if pt.pl<1 then print("game over ;(",40,60,8) stop() end end function _draw() cls() map() line(0,8,127,8,5) print("playerscore:",1,1,10) print(pt.ps,49,1,10) print("stick no",60,1,8) spr(2,pt.px,pt.py) --player if pt.pl>2 then spr(7,99,0) end if pt.pl>1 then spr(7,108,0) end if pt.pl>0 then spr(7,117,0) end for a in all(at) do a:ad() end for h in all(ht) do h:hd() end end
متطلبات النظام
متطلبات النظام لهذه اللعبة غير متاحة بعد — عُد لاحقًا.