Author Topic: Jedibot, 5 points  (Read 4759 times)

jedislight

  • Administrator
  • Newbie
  • *****
  • Posts: 4
    • View Profile
Jedibot, 5 points
« on: February 21, 2012, 10:29:49 PM »
A basic corner bot. Nothing too exciting, but it is the most advanced bot I have put together during the first weeks of development.

Code: [Select]
#author:jedislight
armor:0 # 5
energy:2 # 15
shields:0 # 5
cpu:2 # 10
radar:on
instructions:
radarbots
west 32 add xbar store
north 32 add  ybar store

-3 xvel
-3 yvel

barloop seekloop fork

barloop:
0 joined store
xbarloop continue fork
continue:
ybarloop joinwait fork

xbarloop:
   joinx xbarloop
      x xbar sub dupe 32 < swap -32 > and 
   ifelsegoto
   

ybarloop:
   joiny ybarloop
      y ybar sub dupe 32 < swap -32 > and 
   ifelsegoto
   
joiny:
   0 yvel
   joined 1 add joined store
   join
   
joinx:
   0 xvel
   joined 1 add joined store
   join
   
joinwait:
   joinwait joined 2 < ifgoto
 
#were in a corner now !
xswap yswap 2.0 rand 1.0 > ifelsegoto

xswap:
   xbar chs xbar store
   xpos xneg 0 x > ifelsegoto
   xpos:
      3 xvel
      barloop goto
   xneg:
      -3 xvel
      barloop goto

yswap:
   ybar chs ybar store
   ypos yneg 0 y > ifelsegoto
   ypos:
      3 yvel
      barloop goto
   yneg:
      -3 yvel
      barloop goto
     
     
seekloop:
   5 aiming add aim
   seekloop radar not ifgoto
   aiming 45 add aim

   lockloop:
      energy 2 div fire
      lockloop seekloop range ifelsegoto

edit - adjusted build points for 0.6 changes
« Last Edit: March 04, 2012, 10:03:04 AM by jedislight »