Commit Graph

89 Commits

Author SHA1 Message Date
Doyle Thai 6b2e759257 Basic audio with stb_vorbis decoding and openal 2016-07-25 22:10:50 +10:00
Doyle Thai 002d6524f1 Remove extraneous files, separate assets 2016-07-24 23:12:29 +10:00
Doyle Thai 71faaa78c4 Add openal-soft dependency, update opengl macro 2016-07-24 22:19:25 +10:00
Doyle Thai 8fc895e584 Unify entity update to only use state switches
Remove the use of beginAttack and endAttack in the entity update loop and
delegate all changes to entity through state switching. This
consolidates the flow of data in the loop more consistently by going
through one master function. This also minimises the number of
entry-points to functions that will update an entity states- for ease of
comprehension.
2016-07-24 01:22:59 +10:00
Doyle Thai a43102ee26 Rotate targetting reticule to mob. Add pivot point
Notion of pivot point now for rotating, i.e. the anchor point at which
rotations are applied. Rotating the reticule is done by using inverse
trigonometry, namely atan2f.
2016-07-23 21:26:15 +10:00
Doyle Thai 358f850a2c Fixed wrong cross referencing attack to anim data 2016-07-22 19:29:12 +10:00
Doyle Thai 7b13615614 More corner case checks for battle interaction 2016-07-21 02:04:17 +10:00
Doyle Thai 2707c46df1 Add better support for multi-entity battles 2016-07-20 21:42:45 +10:00
Doyle Thai 906d66a12a Inline entityUpdateAndRender, clean up if branches 2016-07-20 20:13:44 +10:00
Doyle Thai 4f5270881f Add utility scripts for finding todos and statics 2016-07-20 17:15:31 +10:00
Doyle Thai 3aaad2fba3 Add basic entity death code for singular entity 2016-07-20 02:23:11 +10:00
Doyle Thai 3e2287e13a Link avatar UI health display to hero health 2016-07-20 01:06:29 +10:00
Doyle Thai fd94eb5afd Mobs battle with hero, engine architect. changes
Mobs battle in real-time with the hero when in range. Start encapsulating
logic into entityStateSwitch() to organise entity properties changing
between different states.

Introduce basic concept of memory management in MemoryArena. Begin passing
around a memory object to track memory usage and eventually delegate
memory allocations through. Remove the old memory tracker in the debug
object and incorporate into engine primarily.

Add a debug console for logging information and events to the screen in
a console-like fashion. Debug is now initialised after the game, this is
so that you can pass the game's memory arena and font file to the debug
services. Debug services now properly initialise debug element positions
from this information and not through the update routine.
2016-07-19 21:19:26 +10:00
Doyle Thai 5fc58ca643 Create notion of state switching for entities
Encapsulate the process required to switch an entity from state to state
using a state switching function. Add extra minor debug markers.
2016-07-19 15:19:08 +10:00
Doyle Thai 403999b566 Change Animation names, stop input parse on attack 2016-07-19 13:32:31 +10:00
Doyle Thai b8b76cecd3 Switch entity anims to use references to assets 2016-07-19 03:47:32 +10:00
Doyle Thai fff9e6e5b2 Implement battle time bar attacking within range
The main debug drawing elements have been moved to debug.c to avoid
cluttering up the main game file. The downside is that thus far the debug
values only track values post-update.

We have a notion of begin attack and end attack to allow code to drive the
animation system and apply effects after an attack animation has
completed.
2016-07-18 22:02:47 +10:00
Doyle Thai e00ef52f8a Add hitbox size/render size notion 2016-07-18 20:37:14 +10:00
Doyle Thai c52d872058 Basic attack queue implemented for hero 2016-07-18 20:16:29 +10:00
Doyle Thai 129234fbeb Merge update with render section in update loop 2016-07-18 00:54:21 +10:00
Doyle Thai 4541023396 Basic tackle animation added 2016-07-18 00:45:39 +10:00
Doyle Thai 7971b10b74 Remove int v2 type, change V2i to cast i32 to f32
Mixing and matching V2 int and float types in the code creates too much
necessary work when an integer implementation has to interact with float
implementation. Let V2i create the cast for us and use floats for all
vector operations since they are mostly mathematic.
2016-07-17 23:45:59 +10:00
Doyle Thai 2745a8e25a Add simple animation scheduling infrastructure 2016-07-17 20:24:51 +10:00
Doyle Thai 88108bce19 Delete old assets, remove anim update in renderer
Begin to add notion of a hitbox entity size and the rendering size.
Dynamic entities such as players will have animations that should exceed
the size of the actual player, we should be able to render it at the
desired size even if larger than the actual size.

Collision still occurs on the entity size (i.e. hitbox). Remove the notion
of updating animation in the renderer, we update in WorldTraveller,
removing any concept of passing a "deltatime" to the renderer. The
renderer's purpose is to draw not parse animation logic.
2016-07-17 19:24:19 +10:00
Doyle Thai 62c5fe0629 Switch animation indexing to enum, toggle anim on spacebar 2016-07-17 17:16:09 +10:00
Doyle Thai ca6790cb1c Add entity action timer to schedule commands 2016-07-17 15:27:37 +10:00
Doyle Thai a426461dad Fix up include headers, try to reduce dependencies
Ensure that all headers are self-sufficient instead of relying on included
headers to include headers for execution.
2016-07-16 23:27:52 +10:00
Doyle Thai 6da8eff9b1 Fix hero avatar moving with camera 2016-07-16 21:08:30 +10:00
Doyle Thai 2d9fded235 Group texture & texture rect together in renderer 2016-07-16 20:21:49 +10:00
Doyle Thai 0d5725eb97 Entities now have health values associated 2016-07-16 20:06:52 +10:00
Doyle Thai 6c3ef63a65 Draw hero status on side with profile
Make hero texture rects start using the atlas data structure. Reduce the
number of slots for assets for now to minimise room for error.
2016-07-16 18:51:26 +10:00
Doyle Thai d74cabf5c6 Fix rendering of rects, draw debug target reticule 2016-07-16 17:41:17 +10:00
Doyle Thai d0b4c99787 Create empty texture idea, change function scopes
Some functions which should not be exposed in the API have been switched
to INTERNAL scope. We have a notion of an empty texture in World Traveller
that we can pass in situations where we just want to render a solid
colour with no associated texture.

The alternative to this was creating a separate shader for rendering
primitives but would require at some point to expose the AssetManager to
the renderer or the user on behalf has to manually switch shaders before
rendering (non-intuitive).
2016-07-16 17:15:03 +10:00
Doyle Thai 86b4d1e206 Add distance to battle range metric in pixels 2016-07-16 02:34:44 +10:00
Doyle Thai 12fbc1000e Basic framework for scaling text, unimplemented 2016-07-15 18:34:23 +10:00
Doyle Thai 0551f05e73 Rotate around entity center, update math notation
Change #define math functions to uppercase for consistency
2016-07-14 23:15:42 +10:00
Doyle Thai b1875077b7 Additional debug string rendering infrastructure
Separate notion of rendering a static string, i.e. for debug display that
is absolutely positioned, and rendering of a regular string that moves
with the game camera.
2016-07-12 18:11:31 +10:00
Doyle Thai d82afe49d0 Add memory allocation tracking data to debug state 2016-07-09 21:42:36 +10:00
Doyle Thai 54ecddad2f Add function call counting to debug infrastructure 2016-07-09 20:59:54 +10:00
Doyle Thai 1f364f7024 Update debug data architecture and methods 2016-07-09 20:46:04 +10:00
Doyle Thai ea50aeb44e Allow color modulation of sprites, refactor renderer init 2016-07-09 16:08:03 +10:00
Doyle Thai ea2656c0bd Fix bug accumulating debug strings without resetting 2016-07-08 21:36:26 +10:00
Doyle Thai ebcdd779b9 Lock camera to the bounds of the world 2016-07-08 21:21:49 +10:00
Doyle Thai f6ada44b41 Add rudimentary camera and side scrolling support 2016-07-08 21:06:43 +10:00
Doyle Thai ad48dd5062 Add notion of entity type identifier to entities 2016-07-08 17:54:56 +10:00
Doyle Thai fa7947fb90 Abstract add entity and animation into functions 2016-07-08 17:44:41 +10:00
Doyle Thai c9fc34aee1 Move rendering of tiles into rendering of entities
Downgraded background rendering to each tile individually (no batching)
temporarily such that we can render all entities in one function.
2016-07-08 16:09:18 +10:00
Doyle Thai 4b74bb9474 Delay update of debug string rendering
More meaningful to see values update over a larger period of time than
instantaneously.
2016-07-08 14:37:18 +10:00
Doyle Thai 46629a489a Add debug rendering, fix misaligned pos render bug
Rendering using a non-default quad specifies normalised coordinates
relative to the frame buffer size. Hence each render of these frames
should origin from (0,0) any other value is invalid.
2016-07-08 02:45:37 +10:00
Doyle Thai a04c43681d Removed rounding in glyphs per row overestimating 2016-07-07 22:44:22 +10:00