ÎÌÌÌ̈ˆˆ¬ªªª¬ˆˆˆ¬ÌÌ̬ÌÀ̬ÌÀ̬ÌÀÌÌÌìÌÀÀî̬ÀÌÀ¬ÀÀÀ¬ÀÀÀ¬ÀÀÎÌÌÌ̈ˆˆ¬ªªª¬ˆˆˆ¬ÌÌ̬ÌÌ̬ÌÀ̬ÌÀÌÌÌìÌÀÀî̬ÀÌ̬ÀÀÀ¬ÀÀÀ¬ÀÀ¬ÌÌ̬ªªª¬ª¬ª¬ªÊ̬ªªªŒˆˆˆÌÀÌÎÌÌÎ̬̪ªÀ쬪ÀÀÀÌîÀìîÌÌîî¬ÌÌ̬ªªª¬ª¬ª¬ªÊ̬ªªªŒˆˆˆÌÀÌÎÌÌÎ̬̪ªÀ쬪ÀÀÀÌîÀìîÌÌîî >…?""""""""""""""""""""""""""""""""""""""""""""""""""ÀÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ ÐÝÝÝ ÝÝ ÝÝ Ð݆-- title: game title -- author: game developer, email, etc. -- desc: short description -- site: website link -- license: MIT License (change this to your license of choice) -- version: 0.1 -- script: lua rand=math.random abs=math.abs sqrt=math.sqrt t=0 iter=1 ent_base={} ent={} for i=iter,iter+1 do ent[iter]={ t=0, x=120,y=68,vx=0,vy=0, health=100,effect={}, Jump_Height=200,Jump_Boost=1, Active=0, box={},data={},hit={}, name=nil, type='none' } iter=iter+1 if i==1 then ent[i].name='player' end end function TIC() t=t+1 cls(0) for i,j in pairs(ent) do local x,y,vx,vy = j.x,j.y,j.vx,j.vy if j.name=='player' then rect(0,0,10,10,2) end x=x+vx/100 y=y+vy/100 if abs(vx)>1 then vx=vx-(vx/abs(vx))*2-1 else vx=0 end if abs(vy)>1 then vy=vy-(vy/abs(vy))*2-1 else vy=0 end if j.type=='none' then if y+vy/100>133 then y=133 vy=0 end vy=vy+6 local scale=.5 circ(x,y,2,3+(i-1)*10) rect(x-100*scale/2,y-6,j.health*scale,1,12) else circb(x,y,2,2) end for a,b in pairs(j.box) do for u,v in pairs(ent) do if j.hit[u]~=1 then local x,y=b.x+j.x,b.y+j.y line(x,y,v.x,v.y,2) print(a,120+u*10,68) coll(b,v,j) if b.r then circb(x,y,b.r,5) elseif b.w then rectb(x-b.w,y-b.h,b.w*2,b.y*2,5) end end end end if j.name=='player' then if btnp(0) and y>132.9 then vy=-j.Jump_Height*j.Jump_Boost end j.Jump_Boost=1 if btn(1) then vy=vy+10 end if btn(2) then vx=vx-10 end if btn(3) then vx=vx+10 end end logic(j) j.x,j.y,j.vx,j.vy = x,y,vx,vy end -->>JumpBoost if btnp(4) then newent(ent[1].x,136,0,0,'Jump_Boost',BoxSet('Jump_Boost1'),{1.5}) end -->>Slash if btnp(5) then newent(ent[1].x,ent[1].y,0,0,'Blast',BoxSet('Blast1'),{150}) end -->>Blast -->>Firewall -->>Domain Expansion end ----- -->>Functions ----- function dist(x,y,a,b) return sqrt((x-a)^2+(y-b)^2) end --Effect add function effect(index,id,tick,strength,limit) j=index.effect[id] if j~=nil then j[1]=(j[1]+tick)/2 j[2]=(j[2]+strength)/2 if j[3]10 then entity.box[1].r=entity.box[1].r*1.5+1 end if entity.box[1].r>30 then entity.box[1].r=30 end if T>20 then entity=nil end else --side2 local D=dist(x,y,target.x,target.y) rect(5,5,20,20,10) if T>10 then entity.hit[target]=1 else strength=strength*.1 end target.vx=target.vx+(target.x-entity.x)/D*strength target.vy=target.vy+(target.y-entity.y)/D*strength end end end --Hit Applier function apply(entity,target) local name=entity.name if name=='Jump_Boost' then target.Jump_Boost=target.Jump_Boost*entity.data[1] end if name=='Blast' then end end --Entity Creator function newent() end --Box Preset function BoxSet(ID) local preset={} if ID=='Slash1' then preset={{x=7,y=10,r=7},{x=10,y=0,r=10},{x=7,y=-10,r=7}} end if ID=='Jump_Boost1' then preset={{x=0,y=0,w=6,h=10,r=10}} end if ID=='Blast1' then preset={{x=0,y=0,r=0}} end if ID=='Firewall1' then for i=1,6 do preset[#preset+1]={} preset[#preset].w=5 preset[#preset].h=3 end end return preset end --Entity --x,y,vx,vy,health,effect,Jump_Height,Jump_Boost,Active,Box,Data,Hit,name,type --x,y,vx,vy,effect,Jump_Height,Jump_Boost,Active,Box,Data,Hit,name,type --x,y,vx,vy,name,box,data,effect,type function newent(x,y,vx,vy,name,box,data,effect,type) ent[iter]={} ent[iter].t=0 ent[iter].x=x or 120 ent[iter].y=y or 68 ent[iter].vx=vx ent[iter].vy=vy ent[iter].name=name or 'base' ent[iter].box=box or {} ent[iter].data=data or {} ent[iter].effect=effect or {} ent[iter].type=type or 'hitter' ent[iter].hit={} ent[iter].Jump_Height=200 ent[iter].Jump_Boost=1 ent[iter].health=100 ent[iter].Active=0 iter=iter+1 end