@name EGP hud Animated
@inputs EGP:wirelink
@persist Height I X R
#[--------------------===============[|Created by IronManhood|]===============--------------------]#
if(first())
    {
        EGP:egpClear() # Clears the EGP
        
        EGP:egpDrawTopLeft(1) # makes objects draw from top left corner instead of from the center of the object
        
        Height=egpScrH(entity():owner())/2 # this gets the pixel height of the resolution you are currently running
        X=0
        
        EGP:egpBox(1,vec2(X,Height),vec2(64,64)) # Creates and egpBox object 64x64 pixels
        
        timer("tmr1",3000) # Creates a timer named "tmr1" for 3 seconds or 3000 miliseconds
    }
if(clk("tmr1")) {R=!R,timer("tmr1",3000)} # if the current execution was caused by "tmr1" then R changes from 0 to 1 or from 1 to 0
# and then it restarts the timer to make the R change every 3 seconds

if(R==0&clk("tmr2")|!R) # while R=0 this if statement will run when the timer "tmr2" causes the e2 to execute
    {
        X=X+2 # everytime the e2 executes it adds 2 to X
        
        EGP:egpPos(1,vec2(X,X)) # This sets the position of the box object
        
        timer("tmr2",1) # this timer causes the e2 to execute every millisecond
    }
elseif(R==1&clk("tmr2")) # while R=1 this if statement will run when the timer "tmr2" causes the e2 to execute
    {
        X=X-2 # everytime the e2 executes it subtracts 2 from X
        EGP:egpPos(1,vec2(X,X))
        timer("tmr2",1)
    }
