help! LUA

Technomancer - Custom level - from Android
PlayEdit3 players liked this.Log in to like this level.

I want to make a lua that makes sprite like "enemy" i can make one but i want to make one code handel multiple enemies/sprites maybe some lua masters like:ZardOz,TechZ,Demon666 will help me :D

Views: 571 Downloads: 56 Unique objects: 1 Total objects: 1

Discuss this level

Log in to comment on this level.
  • Technomancer: @Johnsinna: i cant make that one but i will learn it :)
  • Johnsinna: I know
  • Technomancer: @Johnsinna: WOW!so long
  • Johnsinna: ox1=0
    oy1=0
    ox2=this:read(0)*100
    oy2=0

    box=world:get_entity_by_id(27, 108)
    angle=box:get_angle()
    px=math.cos(angle) * (ox2-ox1) - math.sin(angle)*(oy2-oy1) + ox1
    py=math.sin(angle) * (ox2-ox1) + math.cos(angle)*(oy2-oy1) + oy1
    x1,y1=box:get_position()
    x2=x1+px
    y2=y1+py

    px1={}
    py1={}
    px2={}
    py2={}


    dx=x2-x1
    dy=y2-y1

    dxy=math.sqrt((x2-x1)^2+(y2-y1)^2)

    pn=1
    tpn=math.floor(dxy+0.5)

    this:set_draw_tint(1,1,1,1)
    ran=0.2+this:read(1)*0.6
    while pn <= tpn do
    if pn==1 then
    px1[pn]=x1/pn
    py1[pn]=y1/pn
    px2[pn]=x1/pn
    py2[pn]=y1/pn
    else
    px1[pn]=px1[pn-1]+dx/tpn+math.random(-1*ran,ran)*math.random()
    py1[pn]=py1[pn-1]+dy/tpn+math.random(-1*ran,ran)*math.random()
    px2[pn]=px2[pn-1]+dx/tpn+math.random(-1*ran,ran)*math.random()
    py2[pn]=py2[pn-1]+dy/tpn+math.random(-1*ran,ran)*math.random()
    end

    local e = world:raycast(px1[pn]+1, py1[pn]-1,px1[pn]-1,py1[pn]+1)
    if e then
    egid=e:get_g_id()
    eid=e:get_id()
    if egid==59 then
    this:write(0,1)
    end
    end

    -->this:draw_sprite(px1[pn], py1[pn], 0.0, 1.0, 1.0, 0, 0, 1, 1)
    pn=pn+1
    end

    this:set_draw_tint(0,0,0,1)
    -->this:draw_line(x1, y1, x2, y2, 0.10)


    for n1=2, #px1 do
    this:set_sprite_tint(60/255,170/255,212/255,1)
    this:draw_line(px1[n1-1],py1[n1-1],px1[n1]+0.03,py1[n1],0.3)
    end

    for n1=2, #px1 do
    this:set_sprite_tint(1,1,1,1)
    this:draw_line(px1[n1-1],py1[n1-1],px1[n1]+0.01,py1[n1],0.1)
    end

    for n2=2, #px2 do
    this:set_sprite_tint(60/255,170/255,212/255,1)
    this:draw_line(px2[n2-1],py2[n2-1],px2[n2]+0.01,py2[n2],0.3)
    end

    for n2=2, #px2 do
    this:set_sprite_tint(1,1,1,1)
    this:draw_line(px2[n2-1],py2[n2-1],px2[n2]+0.01,py2[n2],0.1)
    end
  • Johnsinna: Lightning is
  • Technomancer: @Johnsinna: Oo ok
  • Johnsinna: I only know fire and lightning
  • Technomancer: @Johnsinna: really?
  • Johnsinna: Hi I can help in a way with fire or lightning codes
  • Technomancer: @Demon666:help!
  • Technomancer: @TechZ:help!
  • Technomancer: @ZardOz:help!

LEVEL ID: 10020