-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement part 5 of the tutorial. Add 0.5 to the view radius for nice…
…r circle.
- Loading branch information
Showing
7 changed files
with
351 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
tjc source/main.vx source/kernel32.vx source/sdl.vx source/sdlimage.vx source/utils.vx bin/SDL2.dll bin/SDL2_image.dll C:\Windows\System32\kernel32.dll --of=bin/main.exe | ||
tjc source/main.vx source/kernel32.vx source/sdl.vx source/sdlimage.vx source/tile.vx source/entity.vx source/window.vx source/utils.vx bin/SDL2.dll bin/SDL2_image.dll C:\Windows\System32\kernel32.dll --of=bin/main.exe --print-time --print-mem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import utils; | ||
|
||
enum EntityFlags : u8 { | ||
blocks = 1 << 0, | ||
} | ||
|
||
struct Entity | ||
{ | ||
i32 x; | ||
i32 y; | ||
u8 flags; | ||
u8 char; | ||
u8 r; | ||
u8 g; | ||
u8 b; | ||
u8[] name; | ||
|
||
void move(i32 dx, i32 dy) { | ||
print("Move "); | ||
printInt(x); | ||
print(" "); | ||
printInt(y); | ||
x += dx; | ||
y += dy; | ||
print(" -> "); | ||
printInt(x); | ||
print(" "); | ||
printInt(y); | ||
print(" "); | ||
print(name); | ||
println(null); | ||
} | ||
|
||
bool blocks() { return flags & EntityFlags.blocks; } | ||
} | ||
|
||
alias EntityId = u16; |
Oops, something went wrong.