else if(degree == 1) _square_size = 150;
else if(degree == 2) _square_size = 100;
else _square_size = 50;
- scalar_t x[] = { -_square_size/2, _square_size/2, _square_size/2, -_square_size/2 };
- scalar_t y[] = { -_square_size/2, -_square_size/2, _square_size/2, _square_size/2 };
+
+ scalar_t x[] = {
+ -_square_size / 2.0, _square_size / 2.0,
+ _square_size / 2.0, -_square_size / 2.0
+ };
+
+ scalar_t y[] = {
+ -_square_size / 2.0, -_square_size / 2.0,
+ _square_size / 2.0, _square_size / 2.0
+ };
+
_target = new Polygon(0.5, 1.0, 1.0, 0.0, x, y, 4);
_target->set_position(_square_size/2, _square_size/2 + (world_height - _square_size) * drand48(), 0);
_target->set_speed(0, 0, 0);
+
universe->initialize(_target);
universe->add_polygon(_target);
+
if(degree == 4) {
Polygon *obstacle;
scalar_t x[] = { ( 9 * world_width)/20, (11 * world_width)/20,
_target->set_speed(0, 0, 0);
manipulator->force_release();
return 1.0;
- } else return 0.0;
+ } else {
+ return 0.0;
+ }
}
virtual void draw(SimpleWindow *window) {