Commit Graph

78 Commits

Author SHA1 Message Date
Karma Riuk
d6bf526459 Generator now makes the polygons origin at their center of mass, easier for rotation 2023-03-20 15:33:35 +01:00
Karma Riuk
e6a3979de1 Added a generator for polygons to make the init easier 2023-03-14 23:10:31 +01:00
Karma Riuk
48a1b3ade4 Added the possibility to set the fields of the polygon class in a functional programming style 2023-03-14 23:09:48 +01:00
Karma Riuk
37198d4669 fixed implementaion mistake 2023-03-14 22:00:55 +01:00
Karma Riuk
9fd87b7f29 Simple implementation of polygons, you can create them in the init and draw them 2023-03-14 21:46:36 +01:00
Karma Riuk
7a5bf13575 Added a way to output vec2d in an easy way 2023-03-14 21:45:44 +01:00
Karma Riuk
d0670178c0 Reformated main.cc and spaceship.cc 2023-03-14 21:45:20 +01:00
Karma Riuk
af31bc7148 Added entries to gitignore 2023-03-10 21:31:52 +01:00
Antonio Carzaniga
c1dc49a9dc GUI controls for restitution coefficient and gravity field 2022-12-28 18:50:12 +01:00
Antonio Carzaniga
19125826bd added game pause/resume toggle 2022-12-28 12:42:14 +01:00
Antonio Carzaniga
6078f57647 Merge branch 'inelastic-collisions' into c++-port 2022-12-28 11:47:05 +01:00
Antonio Carzaniga
5a6fea0522 no penetration also for central gravity ball 2022-12-27 18:26:03 +01:00
Antonio Carzaniga
db219a255a inelastic collisions, controllable restitution coefficient 2022-12-27 17:54:40 +01:00
Antonio Carzaniga
f30ca5e594 collision check enabled by default using simple check. 2022-06-10 12:47:33 +02:00
Antonio Carzaniga
94ec166a4a fix variable renaming in ball_elastic_collision. 2022-06-10 12:47:03 +02:00
Antonio Carzaniga
4725f1eb6a more meaningful variable names in elastic collision for balls 2022-06-01 13:06:55 +02:00
Antonio Carzaniga
7064eb5174 2D vector objects for positions, velocities, etc. 2022-06-01 11:09:35 +02:00
Antonio Carzaniga
2240ba1b69 basic modularization of ball and ball_face classes 2022-05-30 18:05:53 +02:00
Antonio Carzaniga
139d8d2997 fix: using CXX also as linker. 2022-05-30 18:03:41 +02:00
Antonio Carzaniga
8f9a8b71c9 cleared unused game framework declarations. 2022-05-30 16:02:25 +02:00
Antonio Carzaniga
4c2273d271 first, basic transition to C++ 2022-05-30 15:59:45 +02:00
Antonio Carzaniga
f2203cfa00 (new_ball_face) fixed memory leak for cairo patterns. 2021-12-12 11:54:43 +01:00
Antonio Carzaniga
53e71fa27d (gravity) added radial, Newtonian (1/r^2) force field 2021-12-12 00:36:07 +01:00
Antonio Carzaniga
dc0e5be086 (spaceship_draw) better shape for thrust waves 2021-12-11 22:29:55 +01:00
Antonio Carzaniga
9028f1af74 modularization: main, game, balls, c_index, spaceship, gravity 2021-12-11 21:32:48 +01:00
Antonio Carzaniga
1fec301126 (window) removed global variable for game window. 2021-12-11 18:05:13 +01:00
Antonio Carzaniga
3eb4f1f243 removed inoperative clear-alpha feature. 2021-12-03 16:05:51 +01:00
Antonio Carzaniga
1c451f76ef (draw_frame) central frame-drawing function, using draw-event context. 2021-12-03 16:00:36 +01:00
Antonio Carzaniga
3d6751cd15 (spaceship_init_state) larger, more visible spaceship (default radius). 2021-12-03 15:59:29 +01:00
Antonio Carzaniga
b3bb1666fa (draw_gravity_vector) saving/restoring cairo context, for isolation. 2021-12-03 15:58:36 +01:00
Antonio Carzaniga
896470f7bf slight amplification of thrust control. 2021-12-03 00:32:16 +01:00
Antonio Carzaniga
b2e760a749 added spaceship, with basic direction and thrust control. 2021-12-03 00:29:18 +01:00
Antonio Carzaniga
dfd7ca908b gravity control through scroll movements 2021-12-01 20:28:41 +01:00
Antonio Carzaniga
87db81dcfe modularization of c_index, basic balls data. 2021-12-01 20:18:19 +01:00
Antonio Carzaniga
fb00e29a0d using draw signals. 2021-06-13 17:38:07 +02:00
Antonio Carzaniga
b7b39e4034 improved timing and load statistics 2021-06-08 21:24:55 +02:00
Antonio Carzaniga
6d3fea4443 slight improvement in shaded pattern 2021-06-08 21:00:31 +02:00
Antonio Carzaniga
5ba97e9edf shaded ball pattern. 2021-06-07 13:38:13 +02:00
Antonio Carzaniga
d033118653 working gtk-3.0 version
- removed expose event
 - added repositioning after reconfigure event
 - disabled all tangential-friction mechanics
2021-06-07 12:03:55 +02:00
Antonio Carzaniga
3309523725 face objects and cache; port to gtk-3.0. 2021-01-12 15:55:25 +01:00
Antonio Carzaniga
68a33722c8 removed random colors from rotation faces. 2021-01-09 20:33:40 +01:00
Antonio Carzaniga
6b59a065e4 added face rotation command-line switch. 2021-01-03 13:05:23 +01:00
Antonio Carzaniga
76bb057e6c basic, independent, constant-speed rotation. 2019-12-18 21:18:21 +01:00
Antonio Carzaniga
300e71cbde fixed typo in error message. 2019-12-05 16:39:55 +01:00
Antonio Carzaniga
a0fa9c4925 using canvas and local cairo context. 2019-12-05 16:34:31 +01:00
Antonio Carzaniga
1fb6d9d94d typo in usage message. 2019-12-01 22:06:31 +01:00
Antonio Carzaniga
30f48a0114 added stats sampling count option (stats=C). 2019-08-21 12:14:25 +02:00
Antonio Carzaniga
90f9766a87 other minor simplifications. 2019-08-21 10:26:58 +02:00
Antonio Carzaniga
576139b448 minor simplifications in c_index_insert. 2019-08-20 17:23:54 +02:00
Antonio Carzaniga
956e652827 added rectangle binary search tree as collision index. 2019-08-20 16:15:29 +02:00