Could someone help me with modifying this code?
task QED(x, y, speed, angle, graphic, delay, num, Bombres) {
let obj=Obj_Create(OBJ_SHOT);
let bouncecount = num;
Obj_SetPosition(obj, x, y);
Obj_SetAngle(obj, angle);
Obj_SetSpeed(obj, speed);
ObjShot_SetGraphic(obj, graphic);
ObjShot_SetDelay(obj, 0);
ObjShot_SetBombResist (obj, Bombres);
while(Obj_BeDeleted(obj)==false && bouncecount > 0) {
if(Obj_GetX(obj)<GetClipMinX) {
Obj_SetAngle(obj, 180 - Obj_GetAngle(obj) );
Obj_SetX(obj, Obj_GetX(obj) + 0.1);
bouncecount -= 1;
}
if(Obj_GetX(obj)>GetClipMaxX) {
Obj_SetAngle(obj, 180 - Obj_GetAngle(obj) );
Obj_SetX(obj, Obj_GetX(obj) - 0.1);
bouncecount -= 1;
}
if(Obj_GetY(obj)<GetClipMinY) {
//Obj_SetAngle(obj, Obj_GetAngle(obj) + (2 * (180 - Obj_GetAngle(obj))) ); //Original NetLogo code
Obj_SetAngle(obj, -1*Obj_GetAngle(obj)); //Equally correct code for Danmakufu
Obj_SetY(obj, Obj_GetY(obj) + 0.1);
bouncecount -= 1;
}
yield;
}
}
I'm trying to make an edit to this code with causes reflection to allow it to double the reflected bullets in an exponential way (1, 2, 4, 8, 16, ...) and reflect up to 10x (512 bullets I think) and then dissapear if they hit the walls again
And happy reply 1000 (me)