ÎÌÌÌ̈ˆˆ¬ªªª¬ˆˆˆ¬ÌÌ̬ÌÀ̬ÌÀ̬ÌÀÌÌÌìÌÀÀî̬ÀÌÀ¬ÀÀÀ¬ÀÀÀ¬ÀÀÎÌÌÌ̈ˆˆ¬ªªª¬ˆˆˆ¬ÌÌ̬ÌÌ̬ÌÀ̬ÌÀÌÌÌìÌÀÀî̬ÀÌ̬ÀÀÀ¬ÀÀÀ¬ÀÀ¬ÌÌ̬ªªª¬ª¬ª¬ªÊ̬ªªªŒˆˆˆÌÀÌÎÌÌÎ̬̪ªÀ쬪ÀÀÀÌîÀìîÌÌîî¬ÌÌ̬ªªª¬ª¬ª¬ªÊ̬ªªªŒˆˆˆÌÀÌÎÌÌÎ̬̪ªÀ쬪ÀÀÀÌîÀìîÌÌîî >Í$ÿÿÿðÿðÿðÿðÿðÿÿÿÿÿðÿÿÿðÿÀÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ ÐÝ-" -" -" ÐÝ;-- 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={t=0, x=120,y=68,vx=0,vy=0,coll=true, health=100,damage=0,effect={}, Jump_Height=200,Jump_Boost=1, Active=0,dir=0, Box={},Data={},Hit={},Shape=0, name=nil} ent={} for i=iter,iter+1 do ent[i]={ t=0, x=120,y=68,vx=0,vy=0,coll=true, health=100,damage=0,effect={}, Jump_Height=200,Jump_Boost=1, Active=0,dir=0, Box={},Data={},Hit={},Shape=0, name=nil } iter=iter+1 if i==1 then ent[i].name='player' end end function TIC() t=t+1 cls() for i,j in pairs(ent) do local x,y,vx,vy = j.x,j.y,j.vx,j.vy 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.coll==true then if y+vy/100>133 then y=133 vy=0 end vy=vy+6 end apply(j) logic(j) for a,b in pairs(j.Box) do for u,v in pairs(ent) do logic(j,b,v) end end if j.name=='player' then if btnp(0) and y>132.9 then vy=-j.Jump_Height*j.Jump_Boost j.Jump_Boost=1 end if btn(1) then vy=vy+10 end if btn(2) then vx=vx-10 end if btn(3) then vx=vx+10 end circ(x,y,2,2) --name,x,y,vx,vy,shape,effect,box,data) if btnp(6) and y>132.9 then newent('Firewall',x,136,0,0,0,{},BoxSet('Firewall1'),{15,{'fire',10,1,16},5,20,vx/abs(vx+1)}) end end if j.name=='firewall' then --rect(120,68,5,5,2) end local scale=.5 circb(x,y,2,3+(i-1)*10) rect(x-100*scale/2,y-6,j.health*scale,1,12) j.x,j.y,j.vx,j.vy = x,y,vx,vy end print(ent_base.x,5,5) end ----- -->>Functions ----- function dist(x,y,a,b) return sqrt((x-a)^2+(y-b)^2) end --Effect add function effect(index,id,tick,stregnth,limit) j=index.effect if j~=nil then j[1]=(j[1]+tick)/2 j[2]=(j[2]+strength)/2 if j[3]MaxH then index.box[i].h=MaxH index.Active=2 end end if index.Active==2 then if index.t>10+((i)*8-i*4) then index.box[i].h=index.box[i].h*.92//1 end end end -- else --Application if abs(index.x-target.x)100 then end end end --Entity Creator --x,y,vx,vy,health,effect,height,boost,active,dir,box,data,hit,shape,name function newent(name,x,y,vx,vy,shape,effect,box,data) ent[iter]={t=0,x=120,y=68,vx=0,vy=0,health=100,damage=0,effect={},Jump_Height=200,Jump_Boost=1,Active=0,dir=0,Box={},Data={},Hit={},Shape=0,name=nil} ent[iter].name=name ent[iter].x=x ent[iter].y=y ent[iter].vx=0 ent[iter].vy=0 ent[iter].coll=false ent[iter].effect=effect or {} ent[iter].box=box or {} ent[iter].data=data or {} ent[iter].shape=shape or 0 iter=iter+1 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=='Firewall1' then for i=1,6 do preset[i]={} preset[i].w=0 preset[i].h=0 end end return preset end