FAQ  •  Register  •  Login

asteroid weapons

<<

tazinator

Posts: 351

Joined: Fri Jul 05, 2013 7:35 pm

Post Tue Mar 25, 2014 9:35 pm

asteroid weapons

Asteroids replace bursts. yea!
  Code:
function main()
    local burstArea = levelgen:findObjectById(2) --1 is the zone ID in this level
    local burstAreageom = burstArea:getGeom()
bf:subscribe(Event.Tick)
end

function onTick(delta)
  --change hostile bursts into asteroids

    local items = {};
    bf:findAllObjects(items,
        ObjType.Burst);
--Try adding ObjType.Asteroid for a surprise!


    for i,item in ipairs(items) do
        local pos = item:getPos();
    local vel = item:getVel();
    local asteroid = Asteroid.new()
    asteroid:setPos(pos)
    asteroid:setSize(1)
    asteroid:setVel(vel)
    levelgen:addItem(asteroid)
    item:removeFromGame()
    end
end
 
Play my new level! Two different teams fight over a nexus: One mainly defends while the other attacks! is fun
viewtopic.php?f=33&p=21002#p21002
<<

Skybax

User avatar

Posts: 1035

Joined: Thu Mar 11, 2010 9:17 am

Location: Washington

Post Tue Mar 25, 2014 10:31 pm

Re: asteroid weapons

That sounds really dangerous.
raptor wrote:Sorry Skybax, I hijacked your signature so I could post lots of info.
Whittling While wrote:Does this mean I finally get quoted in someone's signature?
watusimoto wrote:Who are the devs around here?!?
<<

amgine

Posts: 1399

Joined: Thu Apr 19, 2012 2:57 pm

Post Sat Oct 25, 2014 11:45 am

Re: asteroid weapons

yeah.....no thanks.

move this thread wrong location.
Bitfighter Forever.

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron