To run, build project by running make
which produces executable. Because I have a custom location for my sfml library, i need to set it by running export LD_LIBRARY_PATH=/usr/local/lib
.
Goal : Try to come up with game engine without referring to existing game engine code.
- Draw Window to screen
- Draw Square to screen
- Use user input to make square move
- Collision Detection
- Basic
- Fix Bugs
- Draw TileMap
- Add texture to TileMap
- Allow character to move to other parts of Map
Finding a library to provide API to draw stuff to screen
LibX11 - Archiac Directly Interfacing with OpenGL -> too involved GLFW SFML - Simplier, more community support
Abstract out and create character
- Created character
- Created tilemap
need to do collision detection.
Very basic collision detection algorithm. Using the library's globalbounds object after each movement we check whether the movement will cause 2 opaque objects to intersect. If intersect we reverse this movement.
Refactored code alittle + added some texture for background
Aim : Allow character to explore other areas of map.
Currently map fits screen just nice, but in reality maps will be much larger then screen. viewpoint should update automatically when character moves past certain boundaries.
solutions:
- when character "moves", the world moves instead, keeping character as center piece.
- Easier to implement.
- More work to be done to properly seperate concerns (Map will now need to know that character exists)
- create a
cameraview
abstraction which contains the current x,y position of the camera and the size of the camera view.- More flexible.
Solving the external / internal linkage problem on tiles.h https://stackoverflow.com/questions/73448068/why-can-i-include-non-primitive-variables-in-my-header-files-without-running-int