ruby-miyako 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/README +275 -20
  2. data/extern.h +21 -1
  3. data/install_miyako.rb +5 -3
  4. data/lib/Miyako/API/audio.rb +11 -6
  5. data/lib/Miyako/API/basic_data.rb +0 -985
  6. data/lib/Miyako/API/bitmap.rb +19 -22
  7. data/lib/Miyako/API/choices.rb +203 -69
  8. data/lib/Miyako/API/collision.rb +451 -9
  9. data/lib/Miyako/API/color.rb +177 -0
  10. data/lib/Miyako/API/diagram.rb +18 -20
  11. data/lib/Miyako/API/fixedmap.rb +207 -73
  12. data/lib/Miyako/API/font.rb +111 -18
  13. data/lib/Miyako/API/i_yuki.rb +1201 -0
  14. data/lib/Miyako/API/input.rb +65 -0
  15. data/lib/Miyako/API/layout.rb +41 -29
  16. data/lib/Miyako/API/map.rb +202 -157
  17. data/lib/Miyako/API/map_event.rb +86 -19
  18. data/lib/Miyako/API/map_struct.rb +268 -0
  19. data/lib/Miyako/API/modules.rb +136 -37
  20. data/lib/Miyako/API/movie.rb +8 -8
  21. data/lib/Miyako/API/parts.rb +63 -20
  22. data/lib/Miyako/API/plane.rb +4 -4
  23. data/lib/Miyako/API/screen.rb +16 -8
  24. data/lib/Miyako/API/sprite.rb +290 -23
  25. data/lib/Miyako/API/sprite_animation.rb +23 -11
  26. data/lib/Miyako/API/sprite_list.rb +406 -183
  27. data/lib/Miyako/API/story.rb +4 -65
  28. data/lib/Miyako/API/struct_point.rb +157 -0
  29. data/lib/Miyako/API/struct_rect.rb +233 -0
  30. data/lib/Miyako/API/struct_segment.rb +641 -0
  31. data/lib/Miyako/API/struct_size.rb +158 -0
  32. data/lib/Miyako/API/struct_square.rb +253 -0
  33. data/lib/Miyako/API/textbox.rb +49 -35
  34. data/lib/Miyako/API/viewport.rb +5 -5
  35. data/lib/Miyako/API/wait_counter.rb +350 -0
  36. data/lib/Miyako/API/yuki.rb +95 -60
  37. data/lib/Miyako/EXT/raster_scroll.rb +30 -8
  38. data/lib/Miyako/EXT/slides.rb +6 -6
  39. data/lib/Miyako/miyako.rb +25 -11
  40. data/lib/miyako.rb +28 -0
  41. data/lib/miyako_require_only.rb +35 -0
  42. data/miyako_basicdata.c +201 -17
  43. data/miyako_collision.c +315 -6
  44. data/miyako_diagram.c +331 -0
  45. data/miyako_drawing.c +26 -7
  46. data/miyako_font.c +259 -129
  47. data/miyako_input_audio.c +24 -14
  48. data/miyako_layout.c +106 -8
  49. data/miyako_no_katana.c +398 -171
  50. data/miyako_sprite2.c +275 -38
  51. data/miyako_transform.c +113 -107
  52. data/miyako_utility.c +34 -48
  53. data/miyako_yuki.c +241 -0
  54. data/sample/Diagram_sample/diagram_sample_yuki2.rb +30 -30
  55. data/sample/Room3/blue.rb +19 -19
  56. data/sample/Room3/green.rb +9 -9
  57. data/sample/Room3/main.rb +12 -12
  58. data/sample/Room3/red.rb +12 -12
  59. data/sample/Room3/title.rb +15 -10
  60. data/sample/collision_test2.rb +2 -1
  61. data/sample/fixed_map_test/fixed_map_sample.rb +7 -6
  62. data/sample/map_test/main_scene.rb +12 -10
  63. data/sample/map_test/map_manager.rb +14 -13
  64. data/sample/rasterscroll.rb +5 -5
  65. data/sample/takahashi.rb +3 -3
  66. data/sample/textbox_sample.rb +7 -6
  67. data/sample/transform.rb +2 -1
  68. data/uninstall_miyako.rb +4 -1
  69. data/win/miyako_no_katana.so +0 -0
  70. metadata +15 -4
  71. data/lib/Miyako/EXT/miyako_cairo.rb +0 -62
  72. data/sample/cairo_sample.rb +0 -25
data/miyako_collision.c CHANGED
@@ -33,6 +33,7 @@ static VALUE mMiyako = Qnil;
33
33
  static VALUE eMiyakoError = Qnil;
34
34
  static VALUE cCollision = Qnil;
35
35
  static VALUE cCircleCollision = Qnil;
36
+ static VALUE cCollisionEx = Qnil;
36
37
  static VALUE cCollisions = Qnil;
37
38
  static VALUE nZero = Qnil;
38
39
  static VALUE nOne = Qnil;
@@ -92,10 +93,18 @@ static VALUE collision_c_collision(VALUE self, VALUE c1, VALUE pos1, VALUE c2, V
92
93
  double r2 = l2 + NUM2DBL(*(prect2+2)) - 1;
93
94
  double b2 = t2 + NUM2DBL(*(prect2+3)) - 1;
94
95
 
95
- if(l1 <= l2 && l2 <= r1 && t1 <= t2 && t2 <= b1) return Qtrue;
96
- if(l1 <= r2 && r2 <= r1 && t1 <= b2 && b2 <= b1) return Qtrue;
97
- if(l2 <= l1 && l1 <= r2 && t2 <= t1 && t1 <= b2) return Qtrue;
98
- if(l2 <= r1 && r1 <= r2 && t2 <= b1 && b1 <= b2) return Qtrue;
96
+ if(l2 <= r1 && r1 <= r2)
97
+ {
98
+ if(t2 <= b1 && b1 <= b2) return Qtrue;
99
+ if(t2 <= t1 && t1 <= b2) return Qtrue;
100
+ return Qfalse;
101
+ }
102
+ if(l2 <= l1 && l1 <= r2)
103
+ {
104
+ if(t2 <= b1 && b1 <= b2) return Qtrue;
105
+ if(t2 <= t1 && t1 <= b2) return Qtrue;
106
+ return Qfalse;
107
+ }
99
108
  return Qfalse;
100
109
  }
101
110
 
@@ -143,8 +152,52 @@ static VALUE collision_c_cover(VALUE self, VALUE c1, VALUE pos1, VALUE c2, VALUE
143
152
 
144
153
  if(l1 >= l2 && r1 <= r2 && t1 >= t2 && b1 <= b2) return Qtrue;
145
154
  if(l1 <= l2 && r1 >= r2 && t1 <= t2 && b1 >= b2) return Qtrue;
146
- if(l2 >= l1 && r2 <= r1 && t2 >= t1 && b2 <= b1) return Qtrue;
147
- if(l2 <= l1 && r2 >= r1 && t2 <= t1 && b2 >= b1) return Qtrue;
155
+ return Qfalse;
156
+ }
157
+
158
+ /*
159
+ :nodoc:
160
+ */
161
+ static VALUE collision_c_covers(VALUE self, VALUE c1, VALUE pos1, VALUE c2, VALUE pos2)
162
+ {
163
+ VALUE *prect1 = RSTRUCT_PTR(rb_iv_get(c1, "@rect"));
164
+ VALUE *prect2 = RSTRUCT_PTR(rb_iv_get(c2, "@rect"));
165
+ VALUE x1, y1, x2, y2;
166
+ collision_get_position(pos1, &x1, &y1);
167
+ collision_get_position(pos2, &x2, &y2);
168
+ double l1 = NUM2DBL(x1) + NUM2DBL(*prect1);
169
+ double t1 = NUM2DBL(y1) + NUM2DBL(*(prect1+1));
170
+ double r1 = l1 + NUM2DBL(*(prect1+2)) - 1;
171
+ double b1 = t1 + NUM2DBL(*(prect1+3)) - 1;
172
+ double l2 = NUM2DBL(x2) + NUM2DBL(*prect2);
173
+ double t2 = NUM2DBL(y2) + NUM2DBL(*(prect2+1));
174
+ double r2 = l2 + NUM2DBL(*(prect2+2)) - 1;
175
+ double b2 = t2 + NUM2DBL(*(prect2+3)) - 1;
176
+
177
+ if(l1 <= l2 && r1 >= r2 && t1 <= t2 && b1 >= b2) return Qtrue;
178
+ return Qfalse;
179
+ }
180
+
181
+ /*
182
+ :nodoc:
183
+ */
184
+ static VALUE collision_c_covered(VALUE self, VALUE c1, VALUE pos1, VALUE c2, VALUE pos2)
185
+ {
186
+ VALUE *prect1 = RSTRUCT_PTR(rb_iv_get(c1, "@rect"));
187
+ VALUE *prect2 = RSTRUCT_PTR(rb_iv_get(c2, "@rect"));
188
+ VALUE x1, y1, x2, y2;
189
+ collision_get_position(pos1, &x1, &y1);
190
+ collision_get_position(pos2, &x2, &y2);
191
+ double l1 = NUM2DBL(x1) + NUM2DBL(*prect1);
192
+ double t1 = NUM2DBL(y1) + NUM2DBL(*(prect1+1));
193
+ double r1 = l1 + NUM2DBL(*(prect1+2)) - 1;
194
+ double b1 = t1 + NUM2DBL(*(prect1+3)) - 1;
195
+ double l2 = NUM2DBL(x2) + NUM2DBL(*prect2);
196
+ double t2 = NUM2DBL(y2) + NUM2DBL(*(prect2+1));
197
+ double r2 = l2 + NUM2DBL(*(prect2+2)) - 1;
198
+ double b2 = t2 + NUM2DBL(*(prect2+3)) - 1;
199
+
200
+ if(l1 >= l2 && r1 <= r2 && t1 >= t2 && b1 <= b2) return Qtrue;
148
201
  return Qfalse;
149
202
  }
150
203
 
@@ -172,6 +225,22 @@ static VALUE collision_cover(VALUE self, VALUE pos1, VALUE c2, VALUE pos2)
172
225
  return collision_c_cover(cCollision, self, pos1, c2, pos2);
173
226
  }
174
227
 
228
+ /*
229
+ :nodoc:
230
+ */
231
+ static VALUE collision_covers(VALUE self, VALUE pos1, VALUE c2, VALUE pos2)
232
+ {
233
+ return collision_c_covers(cCollision, self, pos1, c2, pos2);
234
+ }
235
+
236
+ /*
237
+ :nodoc:
238
+ */
239
+ static VALUE collision_covered(VALUE self, VALUE pos1, VALUE c2, VALUE pos2)
240
+ {
241
+ return collision_c_covered(cCollision, self, pos1, c2, pos2);
242
+ }
243
+
175
244
  /*
176
245
  :nodoc:
177
246
  */
@@ -241,6 +310,52 @@ static VALUE circlecollision_c_cover(VALUE self, VALUE c1, VALUE pos1, VALUE c2,
241
310
  return Qfalse;
242
311
  }
243
312
 
313
+ /*
314
+ :nodoc:
315
+ */
316
+ static VALUE circlecollision_c_covers(VALUE self, VALUE c1, VALUE pos1, VALUE c2, VALUE pos2)
317
+ {
318
+ VALUE *pcenter1 = RSTRUCT_PTR(rb_iv_get(c1, "@center"));
319
+ VALUE *pcenter2 = RSTRUCT_PTR(rb_iv_get(c2, "@center"));
320
+ double r1 = NUM2DBL(rb_iv_get(c1, "@radius"));
321
+ double r2 = NUM2DBL(rb_iv_get(c2, "@radius"));
322
+ double r = (r1 - r2) * (r1 - r2); // y = (x-a)^2 -> y = x^2 - 2ax + a^2
323
+ VALUE x1, y1, x2, y2;
324
+ collision_get_position(pos1, &x1, &y1);
325
+ collision_get_position(pos2, &x2, &y2);
326
+ double cx1 = NUM2DBL(x1) + NUM2DBL(*pcenter1);
327
+ double cy1 = NUM2DBL(y1) + NUM2DBL(*(pcenter1+1));
328
+ double cx2 = NUM2DBL(x2) + NUM2DBL(*pcenter2);
329
+ double cy2 = NUM2DBL(y2) + NUM2DBL(*(pcenter2+1));
330
+ double d = (cx1-cx2) * (cx1-cx2) + (cy1-cy2) * (cy1-cy2);
331
+
332
+ if(r1 >= r2 && d <= r) return Qtrue;
333
+ return Qfalse;
334
+ }
335
+
336
+ /*
337
+ :nodoc:
338
+ */
339
+ static VALUE circlecollision_c_covered(VALUE self, VALUE c1, VALUE pos1, VALUE c2, VALUE pos2)
340
+ {
341
+ VALUE *pcenter1 = RSTRUCT_PTR(rb_iv_get(c1, "@center"));
342
+ VALUE *pcenter2 = RSTRUCT_PTR(rb_iv_get(c2, "@center"));
343
+ double r1 = NUM2DBL(rb_iv_get(c1, "@radius"));
344
+ double r2 = NUM2DBL(rb_iv_get(c2, "@radius"));
345
+ double r = (r1 - r2) * (r1 - r2); // y = (x-a)^2 -> y = x^2 - 2ax + a^2
346
+ VALUE x1, y1, x2, y2;
347
+ collision_get_position(pos1, &x1, &y1);
348
+ collision_get_position(pos2, &x2, &y2);
349
+ double cx1 = NUM2DBL(x1) + NUM2DBL(*pcenter1);
350
+ double cy1 = NUM2DBL(y1) + NUM2DBL(*(pcenter1+1));
351
+ double cx2 = NUM2DBL(x2) + NUM2DBL(*pcenter2);
352
+ double cy2 = NUM2DBL(y2) + NUM2DBL(*(pcenter2+1));
353
+ double d = (cx1-cx2) * (cx1-cx2) + (cy1-cy2) * (cy1-cy2);
354
+
355
+ if(r1 <= r2 && d <= r) return Qtrue;
356
+ return Qfalse;
357
+ }
358
+
244
359
  /*
245
360
  :nodoc:
246
361
  */
@@ -265,6 +380,112 @@ static VALUE circlecollision_cover(VALUE self, VALUE pos1, VALUE c2, VALUE pos2)
265
380
  return circlecollision_c_cover(cCircleCollision, self, pos1, c2, pos2);
266
381
  }
267
382
 
383
+ /*
384
+ :nodoc:
385
+ */
386
+ static VALUE circlecollision_covers(VALUE self, VALUE pos1, VALUE c2, VALUE pos2)
387
+ {
388
+ return circlecollision_c_covers(cCircleCollision, self, pos1, c2, pos2);
389
+ }
390
+
391
+ /*
392
+ :nodoc:
393
+ */
394
+ static VALUE circlecollision_covered(VALUE self, VALUE pos1, VALUE c2, VALUE pos2)
395
+ {
396
+ return circlecollision_c_covered(cCircleCollision, self, pos1, c2, pos2);
397
+ }
398
+
399
+ /*
400
+ :nodoc:
401
+ */
402
+ static VALUE collision_ex_c_collision(VALUE self, VALUE c1, VALUE c2)
403
+ {
404
+ VALUE pos1 = rb_iv_get(c1, "@pos");
405
+ VALUE pos2 = rb_iv_get(c2, "@pos");
406
+ return collision_c_collision(cCollision, c1, pos1, c2, pos2);
407
+ }
408
+
409
+ /*
410
+ :nodoc:
411
+ */
412
+ static VALUE collision_ex_c_meet(VALUE self, VALUE c1, VALUE c2)
413
+ {
414
+ VALUE pos1 = rb_iv_get(c1, "@pos");
415
+ VALUE pos2 = rb_iv_get(c2, "@pos");
416
+ return collision_c_meet(cCollision, c1, pos1, c2, pos2);
417
+ }
418
+
419
+ /*
420
+ :nodoc:
421
+ */
422
+ static VALUE collision_ex_c_cover(VALUE self, VALUE c1, VALUE c2)
423
+ {
424
+ VALUE pos1 = rb_iv_get(c1, "@pos");
425
+ VALUE pos2 = rb_iv_get(c2, "@pos");
426
+ return collision_c_cover(cCollision, c1, pos1, c2, pos2);
427
+ }
428
+
429
+ /*
430
+ :nodoc:
431
+ */
432
+ static VALUE collision_ex_c_covers(VALUE self, VALUE c1, VALUE c2)
433
+ {
434
+ VALUE pos1 = rb_iv_get(c1, "@pos");
435
+ VALUE pos2 = rb_iv_get(c2, "@pos");
436
+ return collision_c_covers(cCollision, c1, pos1, c2, pos2);
437
+ }
438
+
439
+ /*
440
+ :nodoc:
441
+ */
442
+ static VALUE collision_ex_c_covered(VALUE self, VALUE c1, VALUE c2)
443
+ {
444
+ VALUE pos1 = rb_iv_get(c1, "@pos");
445
+ VALUE pos2 = rb_iv_get(c2, "@pos");
446
+ return collision_c_covered(cCollision, c1, pos1, c2, pos2);
447
+ }
448
+
449
+ /*
450
+ :nodoc:
451
+ */
452
+ static VALUE collision_ex_collision(VALUE self, VALUE c2)
453
+ {
454
+ return collision_ex_c_collision(cCollisionEx, self, c2);
455
+ }
456
+
457
+ /*
458
+ :nodoc:
459
+ */
460
+ static VALUE collision_ex_meet(VALUE self, VALUE c2)
461
+ {
462
+ return collision_ex_c_meet(cCollisionEx, self, c2);
463
+ }
464
+
465
+ /*
466
+ :nodoc:
467
+ */
468
+ static VALUE collision_ex_cover(VALUE self, VALUE c2)
469
+ {
470
+ return collision_ex_c_cover(cCollisionEx, self, c2);
471
+ }
472
+
473
+ /*
474
+ :nodoc:
475
+ */
476
+ static VALUE collision_ex_covers(VALUE self, VALUE c2)
477
+ {
478
+ return collision_ex_c_covers(cCollisionEx, self, c2);
479
+ }
480
+
481
+ /*
482
+ :nodoc:
483
+ */
484
+ static VALUE collision_ex_covered(VALUE self, VALUE c2)
485
+ {
486
+ return collision_ex_c_covered(cCollisionEx, self, c2);
487
+ }
488
+
268
489
  /*
269
490
  :nodoc:
270
491
  */
@@ -310,6 +531,36 @@ static VALUE collisions_cover(VALUE self, VALUE c, VALUE pos)
310
531
  return Qnil;
311
532
  }
312
533
 
534
+ /*
535
+ :nodoc:
536
+ */
537
+ static VALUE collisions_covers(VALUE self, VALUE c, VALUE pos)
538
+ {
539
+ VALUE collisions = rb_iv_get(self, "@collisions");
540
+ int i=0;
541
+ for(i=0; i<RARRAY_LEN(collisions); i++){
542
+ VALUE cs = *(RARRAY_PTR(collisions) + i);
543
+ VALUE *cc = RARRAY_PTR(cs);
544
+ if(collision_covers(c, pos, *cc, *(cc+1)) == Qtrue){ return cs; }
545
+ }
546
+ return Qnil;
547
+ }
548
+
549
+ /*
550
+ :nodoc:
551
+ */
552
+ static VALUE collisions_covered(VALUE self, VALUE c, VALUE pos)
553
+ {
554
+ VALUE collisions = rb_iv_get(self, "@collisions");
555
+ int i=0;
556
+ for(i=0; i<RARRAY_LEN(collisions); i++){
557
+ VALUE cs = *(RARRAY_PTR(collisions) + i);
558
+ VALUE *cc = RARRAY_PTR(cs);
559
+ if(collision_covered(c, pos, *cc, *(cc+1)) == Qtrue){ return cs; }
560
+ }
561
+ return Qnil;
562
+ }
563
+
313
564
  /*
314
565
  :nodoc:
315
566
  */
@@ -361,6 +612,40 @@ static VALUE collisions_cover_all(VALUE self, VALUE c, VALUE pos)
361
612
  return ret;
362
613
  }
363
614
 
615
+ /*
616
+ :nodoc:
617
+ */
618
+ static VALUE collisions_covers_all(VALUE self, VALUE c, VALUE pos)
619
+ {
620
+ VALUE collisions = rb_iv_get(self, "@collisions");
621
+ VALUE ret = rb_ary_new();
622
+ int i=0;
623
+ for(i=0; i<RARRAY_LEN(collisions); i++){
624
+ VALUE cs = *(RARRAY_PTR(collisions) + i);
625
+ VALUE *cc = RARRAY_PTR(cs);
626
+ if(collision_covers(c, pos, *cc, *(cc+1)) == Qtrue){ rb_ary_push(ret, cs); }
627
+ }
628
+ if(RARRAY_LEN(ret) == 0){ return Qnil; }
629
+ return ret;
630
+ }
631
+
632
+ /*
633
+ :nodoc:
634
+ */
635
+ static VALUE collisions_covered_all(VALUE self, VALUE c, VALUE pos)
636
+ {
637
+ VALUE collisions = rb_iv_get(self, "@collisions");
638
+ VALUE ret = rb_ary_new();
639
+ int i=0;
640
+ for(i=0; i<RARRAY_LEN(collisions); i++){
641
+ VALUE cs = *(RARRAY_PTR(collisions) + i);
642
+ VALUE *cc = RARRAY_PTR(cs);
643
+ if(collision_covered(c, pos, *cc, *(cc+1)) == Qtrue){ rb_ary_push(ret, cs); }
644
+ }
645
+ if(RARRAY_LEN(ret) == 0){ return Qnil; }
646
+ return ret;
647
+ }
648
+
364
649
  void Init_miyako_collision()
365
650
  {
366
651
  mSDL = rb_define_module("SDL");
@@ -368,6 +653,7 @@ void Init_miyako_collision()
368
653
  eMiyakoError = rb_define_class_under(mMiyako, "MiyakoError", rb_eException);
369
654
  cCollision = rb_define_class_under(mMiyako, "Collision", rb_cObject);
370
655
  cCircleCollision = rb_define_class_under(mMiyako, "CircleCollision", rb_cObject);
656
+ cCollisionEx = rb_define_class_under(mMiyako, "CollisionEx", cCollision);
371
657
  cCollisions = rb_define_class_under(mMiyako, "Collisions", rb_cObject);
372
658
 
373
659
  id_update = rb_intern("update");
@@ -383,21 +669,44 @@ void Init_miyako_collision()
383
669
  rb_define_singleton_method(cCollision, "collision?", collision_c_collision, 4);
384
670
  rb_define_singleton_method(cCollision, "meet?", collision_c_meet, 4);
385
671
  rb_define_singleton_method(cCollision, "cover?", collision_c_cover, 4);
672
+ rb_define_singleton_method(cCollision, "covers?", collision_c_covers, 4);
673
+ rb_define_singleton_method(cCollision, "covered?", collision_c_covered, 4);
386
674
  rb_define_method(cCollision, "collision?", collision_collision, 3);
387
675
  rb_define_method(cCollision, "meet?", collision_meet, 3);
388
676
  rb_define_method(cCollision, "cover?", collision_cover, 3);
677
+ rb_define_method(cCollision, "covers?", collision_covers, 3);
678
+ rb_define_method(cCollision, "covered?", collision_covered, 3);
679
+
680
+ rb_define_singleton_method(cCollisionEx, "collision?", collision_ex_c_collision, 2);
681
+ rb_define_singleton_method(cCollisionEx, "meet?", collision_ex_c_meet, 2);
682
+ rb_define_singleton_method(cCollisionEx, "cover?", collision_ex_c_cover, 2);
683
+ rb_define_singleton_method(cCollisionEx, "covers?", collision_ex_c_covers, 2);
684
+ rb_define_singleton_method(cCollisionEx, "covered?", collision_ex_c_covered, 2);
685
+ rb_define_method(cCollisionEx, "collision?", collision_ex_collision, 1);
686
+ rb_define_method(cCollisionEx, "meet?", collision_ex_meet, 1);
687
+ rb_define_method(cCollisionEx, "cover?", collision_ex_cover, 1);
688
+ rb_define_method(cCollisionEx, "covers?", collision_ex_covers, 1);
689
+ rb_define_method(cCollisionEx, "covered?", collision_ex_covered, 1);
389
690
 
390
691
  rb_define_singleton_method(cCircleCollision, "collision?", circlecollision_c_collision, 4);
391
692
  rb_define_singleton_method(cCircleCollision, "meet?", circlecollision_c_meet, 4);
392
693
  rb_define_singleton_method(cCircleCollision, "cover?", circlecollision_c_cover, 4);
694
+ rb_define_singleton_method(cCircleCollision, "covers?", circlecollision_c_covers, 4);
695
+ rb_define_singleton_method(cCircleCollision, "covered?", circlecollision_c_covered, 4);
393
696
  rb_define_method(cCircleCollision, "collision?", circlecollision_collision, 3);
394
697
  rb_define_method(cCircleCollision, "meet?", circlecollision_meet, 3);
395
698
  rb_define_method(cCircleCollision, "cover?", circlecollision_cover, 3);
699
+ rb_define_method(cCircleCollision, "covers?", circlecollision_covers, 3);
700
+ rb_define_method(cCircleCollision, "covered?", circlecollision_covered, 3);
396
701
 
397
702
  rb_define_method(cCollisions, "collision?", collisions_collision, 2);
398
703
  rb_define_method(cCollisions, "meet?", collisions_meet, 2);
399
704
  rb_define_method(cCollisions, "cover?", collisions_cover, 2);
705
+ rb_define_method(cCollisions, "covers?", collisions_covers, 2);
706
+ rb_define_method(cCollisions, "covered?", collisions_covered, 2);
400
707
  rb_define_method(cCollisions, "collision_all?", collisions_collision_all, 2);
401
708
  rb_define_method(cCollisions, "meet_all?", collisions_meet_all, 2);
402
709
  rb_define_method(cCollisions, "cover_all?", collisions_cover_all, 2);
710
+ rb_define_method(cCollisions, "covers_all?", collisions_covers_all, 2);
711
+ rb_define_method(cCollisions, "covered_all?", collisions_covered_all, 2);
403
712
  }