@@ -236,6 +236,9 @@ public void changeTint(float step) {
236
236
costume .changeTint (step );
237
237
}
238
238
}
239
+ public void changeTint (double step ) {
240
+ this .changeTint ((float ) step );
241
+ }
239
242
240
243
/**
241
244
* Sets the transparency of the sprite.
@@ -265,6 +268,9 @@ public void changeTransparency(float step) {
265
268
costume .changeTransparency (step );
266
269
}
267
270
}
271
+ public void changeTransparency (double step ) {
272
+ this .changeTransparency ((float ) step );
273
+ }
268
274
269
275
/**
270
276
* Hides the sprite. The pen is not effected.
@@ -312,7 +318,7 @@ public void setSize(double percentage) {
312
318
}
313
319
314
320
/**
315
- *
321
+ *
316
322
* @param amount
317
323
*/
318
324
public void changeSize (float amount ) {
@@ -464,6 +470,9 @@ public void setX(float x) {
464
470
this .x = x ;
465
471
this .pen .setPosition (this .x , this .y );
466
472
}
473
+ public void setX (double x ) {
474
+ this .setX ((float ) x );
475
+ }
467
476
468
477
/**
469
478
* Changes x by a certain amount
@@ -474,6 +483,9 @@ public void changeX(float x) {
474
483
this .x += x ;
475
484
this .pen .setPosition (this .x , this .y );
476
485
}
486
+ public void changeX (double x ) {
487
+ this .changeX ((float ) x );
488
+ }
477
489
478
490
/**
479
491
* Returns the y coordinate of the sprite
@@ -503,6 +515,9 @@ public void changeY(float y) {
503
515
this .y += y ;
504
516
this .pen .setPosition (this .x , this .y );
505
517
}
518
+ public void changeY (double y ) {
519
+ this .changeY ((float ) y );
520
+ }
506
521
507
522
/**
508
523
* Return the width of the current costume or the pen size, when no costume is
@@ -703,6 +718,17 @@ public float distanceToSprite(Sprite sprite) {
703
718
return (float ) Math .sqrt (Math .pow (x1 - x2 , 2 ) + Math .pow (y1 - y2 , 2 ));
704
719
}
705
720
721
+ public void setHitbox (int ...points ) {
722
+ int l = points .length / 2 ;
723
+ int [] xPoints = new int [l ];
724
+ int [] yPoints = new int [l ];
725
+ for (int i = 0 ; i < points .length ; i +=2 ) {
726
+ xPoints [i /2 ] = points [i ];
727
+ yPoints [i /2 ] = points [i +1 ];
728
+ }
729
+ this .hitbox = new Hitbox (xPoints , yPoints );
730
+ }
731
+
706
732
public void setHitbox (int [] xPoints , int [] yPoints ) {
707
733
this .hitbox = new Hitbox (xPoints , yPoints );
708
734
}
0 commit comments