
-----------------------------------
TokenHerbz
Sun Sep 25, 2005 12:48 am

Need a better, shorter version...
-----------------------------------
Hey, so in my RPG, to start off the battle scene, i wish to have a pokemon type closer...

The problem, my vertions sloppy, crappy, and i believe extremely unessesary long code...

A) I tryed to use a for inside a for statment to make this easy, but i just suck at thinking, and had problems, so i did it the long way, WHICH is kinda crappy...

B) I ask for you to COPY - PASTE this, and run it, to get an idea of what i want to accomplish, Then i hope you are bored enough to make me a better, shorter verstion, Though if you dont, i would appreciate help on how i can shorted this code...

*********
Here is the CODE

setscreen("Graphics:300;300")

var lx1,lx2,ly1,ly2: int    %%left variable
var tx1,tx2,ty1,ty2: int   %%Top
var rx1,rx2,ry1,ry2: int    %Right
var bx1,bx2,by1,by2: int    %%Bot

%lefts
ly1 := 0
ly2 := 300
lx1:= 0
lx2:= 10
proc left
    drawfillbox(lx1,ly1,lx2,ly2,black)
   % delay(200)
    lx2+= 10
    ly2-= 10
    lx1+= 10
    ly1+= 10    
end left
%tops
ty1 := 300
ty2 := 290
tx1:= 10
tx2:= 290
proc top
    drawfillbox(tx1,ty1,tx2,ty2,yellow)
  %  delay(200)
    tx1+= 10
    tx2-= 10
    ty1-= 10
    ty2-= 10
end top
%%Right
ry1 := 0
ry2 := 300
rx1:= 290
rx2:= 300
proc right
    drawfillbox(rx1,ry1,rx2,ry2,black)
   % delay(200)
    ry1+= 10
    ry2-= 10
    rx1-= 10
    rx2-= 10
end right
%%bottom
by1 := 0
by2 := 20
bx1:= 10
bx2:= 290
proc bottom
    drawfillbox(bx1,by1,bx2,by2,yellow)
  %  delay(200)
    by1+= 10
    by2+= 10
    bx1+= 10
    bx2-= 10
end bottom

loop
    left
    delay(50)
    top
    delay(50)
    right
    delay(50) 
    bottom
    delay(50)
    exit when rx2 