Beholder needs some new toys to play with D:
[QUOTE=Yenairo;51950]Beholder needs some new toys to play with D:[/QUOTE]
Hmm… Nah. I know better than to ask for a kinky gothic lolita… again.
[QUOTE=Shiny;51838]
I was bored. Wall detection is lazy.
[code]if (created) {
setcharani shinyball,;
dontblock;
// CONSTANTS
this.ball_speed = .6;
this.ball_speedvary = .2;
this.ball_zforce = 1.5;
this.ball_zvary = .4;
this.ball_grav = .175;
// VARIABLES
this.ball_bounce = 0;
this.ball_dx = 0;
this.ball_dy = 0;
this.ball_cooldown = 0;
this.ball_zfly = 0;
timeout = 0.05;
}
if (timeout) {
if (z < 1.5 && this.ball_cooldown =< 0) {
for (p=0;p<playerscount;p++) {
this.dx = (x+1.5) - (players[p].x+1.5);
this.dy = (y+2) - (players[p].y+2);
this.dist = (this.dx^2 + this.dy^2)^.5;
if (this.dist < 2) {
this.ball_zfly = this.ball_zforce + random(this.ball_zvary*-1,this.ball_zvary);
this.kickspeed = this.ball_speed + random(this.ball_speedvary*-1,this.ball_speedvary);
this.ball_dx = (this.dx/this.dist)*this.kickspeed;
this.ball_dy = (this.dy/this.dist)*this.kickspeed;
this.ball_bouncetimes = int(random(2,5));
this.ball_bounce = this.ball_bouncetimes;
this.ball_vert = this.ball_zfly;
this.ball_cooldown = .25;
}
}
}
if (this.ball_bounce > 0) {
MoveBall();
z += this.ball_vert;
this.ball_vert -= this.ball_grav;
if (z <= 0) {
if (this.ball_bounce > 0) {
this.ball_dx /= 2;
this.ball_dy /= 2;
this.ball_vert = (this.ball_bounce/this.ball_bouncetimes)^this.ball_zfly;
this.ball_bounce--;
}
}
}
this.ball_cooldown -= 0.05;
timeout = 0.05;
}
function MoveBall() {
x += this.ball_dx;
for (i=0;i<abs(this.ball_dx);i+=1/16) {
this.orientation = (this.ball_dx < 0 ? -1 : 1);
this.check = i * (this.ball_dx < 0 ? -1 : 1);
this.checkx = x + 1.5 + this.check + this.orientation;
if (onwall(this.checkx,y+1+(1/16)) || onwall(this.checkx,y+2) || onwall(this.checkx,y+3-(1/16))) {
x += this.check;
this.ball_dx = this.ball_dx * -1;
break;
}
}
y += this.ball_dy;
for (i=0;i<abs(this.ball_dy);i+=1/16) {
this.orientation = (this.ball_dy < 0 ? -1 : 1);
this.check = i * (this.ball_dy < 0 ? -1 : 1);
this.checky = y + 2 + this.check + this.orientation;
if (onwall(x+.5+(1/16),this.checky) || onwall(x+1.5,this.checky) || onwall(x+2.5-(1/16),this.checky)) {
y += this.check;
this.ball_dy = this.ball_dy * -1;
break;
}
}
}[/code]
[/QUOTE]
THANNNKKKKKKK YOOOOOOOUUUUUUUUUUU SHIIIINNNNNNNNYYYYYYYYY!!!
You’re annoying.