Commit graph

66 commits

Author SHA1 Message Date
92ed732927 Add the customized vectorwrapper pretty-printer for curry. 2017-07-24 01:19:33 +01:00
64969766d9 Try to make collision work - WiP 2017-07-24 01:19:06 +01:00
40967784a3 Add parameter to skip the callback on the first tile.
For example if you are going from tile 1,1 to 1,2 you would get
two notifications if parInclFirst==true, one for 1,1 and one for
1,2. If parInclFirst==false, then you will only get a notification
for 1,2. Note that if the segment passed to to
for_each_voxel_under_segment() is too short and doesn't span over
the initial tile, passing parInclFirst==false will discard the
only callback you would normally get. Effectively this can be used
for a sort of "on tile changed" notification.
2017-07-23 16:22:04 +01:00
084c4d64da Fix the assert triggering sometimes in the raytrace grid traversal. 2017-07-23 04:37:25 +01:00
b0806e9e1c Print "debug" when starting game compiled in debug mode. 2017-03-17 20:13:39 +00:00
1eeb944e68 Make Debug only available in debug builds. 2017-03-17 20:08:12 +00:00
3a05564be9 Add missing include. 2017-03-17 19:52:42 +00:00
d96dbb9fe8 Update vectorwrapper.
Also make the necessary changes to fix the build after the update.
2017-03-17 00:30:34 +00:00
be56c55e3e Add a layer for game characters. 2017-03-15 21:58:51 +00:00
b60bbf3739 Add background layer from IngameScene, not the base class. 2017-03-15 21:58:24 +00:00
9428e63fc2 Layers are now named, so code can request a layer by name. 2017-03-15 21:48:27 +00:00
7a391c5743 Character draws itself. 2017-03-15 09:14:22 +00:00
2d05fd03db Assert that raytracing is going to finish at some point. 2017-03-15 09:13:13 +00:00
d9a943ee4a Add DrawingQueue class.
Big do-it-all commit. Work on this is not finished and there
are a few changes that need to be undone. A bit messy but
that's how it is :/
2017-03-15 09:12:16 +00:00
8a65faf45c Fixes to make safe_ptr work outside of kakoune. 2017-03-12 15:12:44 +00:00
23d7121e76 Add safe_ptr from kakoune. 2017-03-12 15:12:09 +00:00
15e874f0fe Move texture-related code out from Character class. 2017-03-11 12:22:40 +00:00
c320abbed2 Update submodule 2017-03-11 08:51:16 +00:00
0560affdf9 Import clooneljump as a subproject.
Remove manually copy-pasted files taken from cloonelgraphics and
use the up-to-date version from the submodule instead.
2017-03-11 08:22:23 +00:00
c30fe3012c Remove fsgn() which is now unnecessary. 2017-02-10 19:26:46 +00:00
ff91bbbc71 Fix code so raytrace test now passes. 2017-02-10 19:24:44 +00:00
80d0e1c336 Add test for intersection and fix data in raytracer test. 2017-02-10 15:40:26 +00:00
413ff4e558 Expose private functions in grid_raytrace for unit testing. 2017-02-09 19:31:38 +00:00
47aa9f2948 Move everything into a shared lib so unit test can access stuff. 2017-02-09 18:11:09 +00:00
e2d307da52 Initial WiP implementation of 2D grid raytracing. Not working. 2017-02-08 16:39:46 +00:00
f91ff6625f No need for requiring int position here. 2017-02-08 16:37:59 +00:00
24d67c7cd6 Experimental code that turned out to be too slow and got scrapped. 2017-02-08 16:37:12 +00:00
cb8654ac7e Add a TileProperty struct so one can store info about tiles. 2017-02-08 16:36:36 +00:00
5a8c3fcac0 Add Catch for unit testing. 2017-02-08 16:32:55 +00:00
8e1c19df47 Add an fsgn() function.
fsgn() returns -1/0/1 depending on the parameter's sign.
2017-02-08 16:30:48 +00:00
67e8ceefa3 Update licence notice to 2017. 2017-01-30 14:56:16 +00:00
ab02e7ef58 Let Character store a pointer to the world.
It's going to be needed for collision testing.
2017-01-30 14:49:56 +00:00
2062d50775 Use explicit loop 2017-01-30 13:05:26 +00:00
3907ef6d6d Move movement logic out from the gameplay scene.
Character now knows how to move by itself.
2017-01-30 12:29:57 +00:00
7a0d2c3267 Center viewport on the character when possible. 2017-01-27 19:39:47 +00:00
4715552b44 Update to latest vectorwrapper. 2017-01-27 19:37:20 +00:00
952a8af9c6 Register things that need the world size as observers to WorldGrid.
Character and WorldViewport get notified when the world size is set.
This way even if world size never changes they still get notified
about the proper world size as soon as that information is ready,
be it during instantiation or registration. Previously I was having
trouble because at the point where Character was instantiated, the
world size was not known yet. As such, I had to call a
character.update_world_size() function after it became available. The
same happened for the viewport, and this looked a bit too brittle
from the programmer's perspective. Now you just instantiate the
Character and things get sorted out automatically.
2017-01-27 16:07:50 +00:00
0dab671ce4 Forgot to commit this 2017-01-26 19:47:37 +00:00
19889313e2 Make a ConstrainedPosition helper class.
Use the new class to replace the ad-hoc code in worldviewport.
2017-01-26 17:37:12 +00:00
7971e85be5 Fix url to vectorwrapper submodule 2016-11-23 18:25:09 +01:00
9a0e7abb52 Attach GPL3 licence. 2016-11-23 17:54:41 +01:00
38826b94b8 Fix randomly happening floating point error during clipping. 2016-11-09 01:46:36 +01:00
e65c2341c2 Draw a test character to start experimenting. 2016-11-09 01:46:10 +01:00
4c105fc3df Don't move the viewport if it would generate gaps in the map.
In other words, don't let the player see past the end of the world.
2016-11-08 20:34:04 +01:00
5d231206ef Fix rect clipping 2016-11-08 20:15:19 +01:00
89ac57eee7 Don't crash when going past the bottom/right border. 2016-11-07 22:31:52 +01:00
20f8e75937 Use boost spirit to load csv files.
Allow loading of multiple csv files. Iterating on tiles now returns
a list of tiles, in back-to-front order.
Add a nicer tileset (although it's non-free and needs permission from
its author, need to get in touch in due time).
2016-11-07 22:02:46 +01:00
1313dad568 Allow moving past the top-left edge of the world. 2016-11-04 20:31:41 +01:00
d7868800d4 Temporary code to load a csv tilemap from Tiled. 2016-11-04 20:31:17 +01:00
087e1cd8b1 Make the viewport able to return the tile of a given index. 2016-10-31 01:36:30 +01:00