Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan P. C. McQuen <ryanpcmcquen@member.fsf.org>
  • Loading branch information
Ryan P. C. McQuen committed Feb 1, 2020
0 parents commit feab983
Show file tree
Hide file tree
Showing 116 changed files with 10,184 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .clang-format
@@ -0,0 +1,3 @@
---
BasedOnStyle: WebKit
...
6 changes: 6 additions & 0 deletions .clang_complete
@@ -0,0 +1,6 @@
-Wall
-Wextra
-Wno-unused-parameter
-I /usr/include/SDL2
-I /usr/local/include/SDL2
-I C:\INCLUDE
12 changes: 12 additions & 0 deletions .editorconfig
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[Makefile]
indent_style = tab
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
*.sublime-workspace
373 changes: 373 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions Makefile
@@ -0,0 +1,39 @@
TITLE=basque

# \
!ifndef 0 # \
# nmake: \
CP=copy # \
MV=move # \
RM=del # \
SOURCE=source\$(TITLE).c # \
LIBS=-I C:\INCLUDE -L C:\INCLUDE\SDL2 -l SDL2.lib -l SDL2main.lib -l SDL2_image.lib -l SDL2_mixer.lib -l SDL2_ttf.lib -Xlinker /SUBSYSTEM:WINDOWS # \
TARGET=-o $(TITLE).exe # \
!else
# make:
CP=cp -f
MV=mv -f
RM=rm -f
SDL2_FLAGS=`$$(which sdl2-config) --cflags --libs`
SOURCE=source/$(TITLE).c
LIBS=$(SDL2_FLAGS) -l SDL2_image -l SDL2_mixer -l SDL2_ttf
TARGET=-o $(TITLE)
# \
!endif

FLAGS=-Wall -Wextra -std=c99
# FLAGS=-Wall -Wextra -Wno-unused-parameter -std=c99
RELEASE=$(CC) $(SOURCE) $(FLAGS) $(LIBS) $(TARGET)

$(TITLE): source/*.c source/*.h
$(RELEASE)
# Windows will automatically overwrite
# the binary when using `nmake`, but
# we add the clean command for
# people who like that kind
# of thing.
clean:
$(RM) $(TITLE)
$(RM) $(TITLE).exe
debug: source/*.c source/*.h
$(RELEASE) -g
74 changes: 74 additions & 0 deletions README.md
@@ -0,0 +1,74 @@
# Basque

Basque is a top down 2d game engine.

### Basque currently requires:

- SDL2
- SDL2_image
- SDL2_mixer
- SDL2_ttf

---

#### Global keyboard shortcuts:

<kbd>↑</kbd>: Move player North

<kbd>→</kbd>: Move player East

<kbd>↓</kbd>: Move player South

<kbd>←</kbd>: Move player West

<kbd>q</kbd>: Quit

<kbd>e</kbd>: Toggle edit mode

#### Edit mode shortcuts:

<kbd>l</kbd>: Toggle map library

<kbd>Mouse button 1</kbd> (left click): Place tile

<kbd>Mouse button 2</kbd> (right click): Select tile

---

### Getting SDL2 installed:

#### Linux:

##### apt:

```
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev
```

##### dnf:

```
sudo dnf install SDL2-devel SDL2_image-devel SDL2_mixer-devel SDL2_ttf-devel
```

Or whatever the equivalent package is for your distro.

#### Mac:

```
brew install sdl2 sdl2_image sdl2_mixer sdl2_ttf
```

#### Windows:

1. Download the latest VC development files from: https://libsdl.org

2. Place the entire contents of `include` and `lib` under `C:\INCLUDE\SDL2`.

3. Copy all DLLs under `lib` to `C:\Windows\System32` and `C:\Windows\SysWOW64`.

4. Repeat for _SDL2_image_, _SDL2_mixer_, and _SDL2_ttf_.

5. Profit.

---
52 changes: 52 additions & 0 deletions TODO.txt
@@ -0,0 +1,52 @@
x ) Get compilation on Lin/Mac/Win working.
x ) Get portion of sprite sheet rendering on screen.
x ) Fix sprite animations.
x ) Add bounds checking to keep the player from walking off the screen.
x ) Draw background.
x ) Add scrolling of perspective as player moves.
x ) Generate background map from tileset.
x ) Improve map rendering so that player position can be tied to tile in X/Y space.
x ) Only reload `map_layout.txt` if file timestamp is newer.
x ) Improve collision detection.
x ) Hot load tile attributes.
x ) Add music.
x ) Get scrolling working (again).
x ) Detect collision on ticks instead of on input.

) Map editor!
x ) Find out why empty columns are not being outlined.
x ) Draw grid on current screen that shows each tile separated.
x ) Show number of all tiles.
x ) Allow mouse to place a tile.
x ) Allow mouse to clear a tile.
x ) Fix mouse positioning.
x ) Display library or reference map.
x ) Display map library at 0, 0 point on current window.
x ) Investigate seg fault after placing a few tiles.
x ) Improve font outline for tile labels.
x ) Improve border color/thickness, if not showing actual width.
x ) Allow a new row to be added to (and existing rows).
x ) Investigate tile display corruption starting at row 26 for tiles that are greater than 9.
x ) Bulk add tiles (this kind of already works on empty rows, but it is filled with weirdness).
x ) Cannot bulk fill tiles on newlines ... cannot create newlines?
x ) Investigate random segfaults at bounds of map.

) Add a way to delete tiles.
) Implement undo/redo functionality.

x ) Add fullscreen support.
x ) Lock file writing in the map editor, so we don't get race conditions if the user clicks too quickly.

) Improve scrolling, it doesn't move at the right pace (build out a larger map to demo the issue).
) Allow the frame rate to be capped.
) Expand the map.
) Decide whether to look around all tiles for collisions or to expand border attributes for tiles.
) Add ball.
) Add NPC.
) Add dynamic window sizing.


----------------------------------------------------------

Maybes:
) (Map editor) Draw border to match tile attributes?
Binary file added assets/audio/Basque_sample_music.ogg
Binary file not shown.

0 comments on commit feab983

Please sign in to comment.