i made something in gscript for the first time in a year. it’s retarded and buggy as hell, but i thought i should still show everyone sometime soon it will be baddass.
if (created) {
// Initialize the attributes
showcharacter;
setcharprop #3,head0.png;
setcharprop #C0,orange;
setcharprop #C1,white;
setcharprop #C2,blue;
setcharprop #C3,red;
setcharprop #C4,black;
setcharprop #2,shield1.gif;
shieldpower = 1;
dir = 2;
this.mode = 0;
this.px = 0;
this.py = 0;
timeout = .05;
this.speed = .9;
}
if (timeout)
{
if (this.mode==0)
{
if (dir==0)
{
if (playerx>x-3 && playerx<x+3 && playery<y) {this.mode = 1;this.py = playery-1;}
else dir++;
}
if (dir==1)
{
if (playery>y-3 && playery<y+3 && playerx<x) {this.mode = 1;this.px = playerx;}
else dir++;
}
if (dir==2)
{
if (playerx>x-3 && playerx<x+3 && playery>y) {this.mode = 1;this.py = playery+1;}
else dir++;
}
if (dir==3)
{
if (playery>y-3 && playery<y+3 && playerx>x) {this.mode = 1;this.px = playerx;}
else dir=0;
}
}
if (this.mode==1)
{
message I see you!;
setcharani walk,;
if (dir==0)
{
if (playery>y-4 && playery>y && playerx>=x-5 && playerx<=x+5) {thix.py = playery; this.mode = 2;}
else {y-=this.speed;}
}
if (dir==1)
{
if (playerx>x-4 && playerx<x && playery>=y-5 && playery<=y+5) {this.px = playerx;this.mode = 2;}
else {x-=this.speed;}
}
if (dir==2)
{
if (playery<y+4 && playery>y && playerx>=x-5 && playerx<=x+5) {this.py = playery; this.mode = 2;}
else {y+=this.speed;}
}
if (dir==3)
{
if (playerx<x+4 && playerx>x && playery>=y-5 && playery<=y+5) {this.px = playerx;this.mode = 2;}
else {x+=this.speed;}
}
}
if (this.mode==2)
{
message Boom Time!;
freezeplayer .05;
if (dir==0)
{
if (!onwall(x + 0.5,y + 0.5) && !onwall(x + 1,y + 0.5) && !onwall(x + 1.5,y + 0.5))
{
playery=this.py;
this.py-=this.speed;
y-=this.speed;
}
else {hurt 1; setcharani hurt,;sleep 1;this.mode = 0;}
}
if (dir==1)
{
if (!onwall(x - 0.5,y + 1) && !onwall(x - 0.5,y + 2))
{
playerx=this.px;
this.px-=this.speed;
x-=this.speed;
}
else {hurt 1; setcharani hurt,;sleep 1;this.mode = 0;}
}
if (dir==2)
{
if (!onwall(x + 0.5,y + 3) && !onwall(x + 1,y + 3) && !onwall(x + 1.5,y + 3))
{
playery=this.py;
this.py+=this.speed;
y+=this.speed;
}
else {hurt 1; setcharani hurt,;sleep 1;this.mode = 0;}
}
if (dir==3)
{
if (!onwall(x + 2.5,y + 1) && !onwall(x + 2.5,y + 2))
{
playerx=this.px;
this.px+=this.speed;
x+=this.speed;
}
else {hurt 1; setcharani hurt,;sleep 1;this.mode = 0;}
}
}
timeout = .05;
}
yay for this shit
suppose to grab you and run you into a wall. like in l4d