Colin McMillen
983a02b364
remove old Levels file
4 years ago
Colin McMillen
5121f6d775
World: load levels by parsing a JSON level description.
4 years ago
Colin McMillen
9672fabcfd
Add Sprite class & load sprite metadata from JSON.
4 years ago
Colin McMillen
d270efe643
move Player into World
4 years ago
Colin McMillen
65fe870a9a
let Scene decide when to draw itself & when to play music
GitOrigin-RevId: 0eac6682b0
4 years ago
Colin McMillen
29cf5eb0c9
add short music loop to demo stage
GitOrigin-RevId: 7ea3d773b1
4 years ago
Colin McMillen
02b1dd4874
Add simple NPC.
GitOrigin-RevId: 47cd7abaf8
4 years ago
Colin McMillen
de8ca4a374
Add sword-swing sound effects.
GitOrigin-RevId: 946a808c6f
4 years ago
Colin McMillen
f4581ecaf8
Player now takes damage from spikes.
GitOrigin-RevId: e909631621
4 years ago
Colin McMillen
f8fa66385d
Display "Paused" message when paused.
Add a new "Banner" style font for the pause message.
GitOrigin-RevId: 62f9537574
4 years ago
Colin McMillen
026623ac82
Fix memory leaks of graphics resources.
Make Scene & LinesOfSight dispose of the graphics resources they create.
Force GC when a new level is loaded.
GitOrigin-RevId: 0640cced78
4 years ago
Colin McMillen
b858c45b7e
Cycle through levels when player hits the "restart level" button.
GitOrigin-RevId: bbe909515f
4 years ago
Colin McMillen
57d15cbbd9
Load all textures & fonts in one place.
GitOrigin-RevId: 076c86b24f
4 years ago
Colin McMillen
02aba3ad84
Game objects now take in a ContentManager & load their own textures.
GitOrigin-RevId: 4f40548d9f
4 years ago
Colin McMillen
f0ea8d8ef2
Reorganize Content/ into multiple subdirectories.
Add new tilesets from anokolisa.
GitOrigin-RevId: 90cfd52a3c
4 years ago
Colin McMillen
7e7b0f7715
Move most of the drawing code into a Scene class
GitOrigin-RevId: 4515493a3b
4 years ago
Colin McMillen
43f6bded70
draw backgrounds as partially transparent
GitOrigin-RevId: b570a9aab7
4 years ago
Colin McMillen
e2ea2e1d3f
Add ability to restart the level. Fixes #9 .
GitOrigin-RevId: e7a0cdcdde
4 years ago
Colin McMillen
1ffe1444b2
Debug: draw rects as 4 GPU-accelerated lines.
GitOrigin-RevId: 3286d0476b
4 years ago
Colin McMillen
48a9297a57
draw Debug stuff on top of everything (after lighting)
GitOrigin-RevId: e07fbc6b27
4 years ago
Colin McMillen
5d21ff2a0f
Debug.DrawLines: use GPU to draw lines.
Fixes #19 .
GitOrigin-RevId: d837e0ddaf
4 years ago
Colin McMillen
4d64d6fa12
Initialize and dispose of whiteTexture in SneakGame.
Fixes #7 .
GitOrigin-RevId: 024688e8fc
4 years ago
Colin McMillen
f01efcde01
Split LinesOfSight into separate Draw() and Update() functions.
Don't make new arrays every frame.
Partial solution to bug #41 , just need to DrawIndexedPrimitives() now.
GitOrigin-RevId: 0e769d3288
4 years ago
Colin McMillen
93a5d477bb
New FOV algorithm that works pretty well.
Saved for posterity here, approximately:
https://twitter.com/mcmillen/status/1227326054949408768
GitOrigin-RevId: e960dad1d9
4 years ago
Colin McMillen
ff0c9ddc26
Add a transformation matrix to spriteBatch.Draw().
Instead of having every drawable object know how to transform itself based on
the camera position, we pass in a transformation matrix to spriteBatch.Draw().
Unfortunately MonoGame only lets us specify a translation that works over an
entire SpriteBatch.Begin() call, so we need to begin & end separately for
objects that *aren't* supposed to translate at the same rate as the camera.
Fixes #39 .
GitOrigin-RevId: afab72c392
4 years ago
Colin McMillen
80746ecaed
Use world definition from Levels file
GitOrigin-RevId: a5d19f4f08
4 years ago
Colin McMillen
9e4d863bcf
add performance counters to SneakGame. Fixes #33 .
Also, suppress drawing until Draw() has not been IsRunningSlowly for two
frames. This prevents janky behavior that happens during loading (I suspect
while texture loading is happening, but I'm not sure?)
GitOrigin-RevId: 5df31be371
4 years ago
Colin McMillen
0e363de306
change player sprite to ninja
GitOrigin-RevId: 73bc09808a
4 years ago
Colin McMillen
76dbdc6913
Bound camera by right edge of World.
Fixes #32 .
GitOrigin-RevId: e193c89509
4 years ago
Colin McMillen
50479bac3c
while paused, don't clear the list of Debug rects & lines
GitOrigin-RevId: d298abc6ad
4 years ago
Colin McMillen
793b292a29
pass in AABBs instead of Rectangles to Player.Update
GitOrigin-RevId: 08fe1aaf34
4 years ago
Colin McMillen
61b50efa40
make CollisionTargets an array, and don't recompute it every frame
GitOrigin-RevId: 92a02231ed
4 years ago
Colin McMillen
8c6b0e3c92
set vsync = true; setting it false seems to cause crashes on UWP
GitOrigin-RevId: 6f30cefcaa
4 years ago
Colin McMillen
84fa044675
more readability fixed via Visual Studio suggestions
GitOrigin-RevId: 330f13485c
4 years ago
Colin McMillen
4b14aef1b5
make a bunch of fields readonly
GitOrigin-RevId: 0c3533c650
4 years ago
Colin McMillen
0c7c15c047
set target framerate back to 60
GitOrigin-RevId: 7a97b3cd07
4 years ago
Colin McMillen
f5ca85264f
Add Clock class & use it from Player and SneakGame
GitOrigin-RevId: fe20c836ca
4 years ago
Colin McMillen
1ea4d6c39b
don't vsync; set target FPS to 120-ish
GitOrigin-RevId: 724e876b9a
4 years ago
Colin McMillen
87100eaa67
Player.Update now takes a float which is the model time elapsed.
Player.Draw doesn't depend on time elapsed any more.
GitOrigin-RevId: 3396f85f61
4 years ago
Colin McMillen
83839c92ac
add Pause functionality
GitOrigin-RevId: 18fb954757
4 years ago
Colin McMillen
63aa190afe
move Debug.Enabled check into DrawToasts
GitOrigin-RevId: 8265b948f7
4 years ago
Colin McMillen
34e7ab3ee1
make Toasts a list & implement FPS counter as a toast
GitOrigin-RevId: bae35697a0
4 years ago
Colin McMillen
bee17a99af
create Debug.AddLine() function [currently does nothing]
GitOrigin-RevId: c4f9afb4b0
4 years ago
Colin McMillen
938a38bd77
Camera.Update: remove unused time parameter
GitOrigin-RevId: b3c427b9cc
4 years ago
Colin McMillen
ae8fa0d21d
Revert "Add .gitignore and .gitattributes."
This reverts commit 5c9f574644
.
GitOrigin-RevId: 277054282d
4 years ago
Colin McMillen
cb1b78b875
Add .gitignore and .gitattributes.
GitOrigin-RevId: 5c9f574644
5 years ago
Colin McMillen
bbdc3c3053
SneakGame: remove History<GamePadState> & History<KeyboardState>.
GitOrigin-RevId: 1b8dfef93a
4 years ago
Colin McMillen
db6f3e1425
Add Input class to group gamepad & keyboard inputs together.
For motion directions (up/down & left/right), have them cancel each other out
if the player attempts to go in opposite directions at once.
Refactor Player & SneakGame to use the new Input class & remove direct access
to Keyboard & GamePad.
GitOrigin-RevId: 80fbed8874
4 years ago
Colin McMillen
cc37561076
run dos2unix on all source files
GitOrigin-RevId: c65ff59d86
4 years ago
Colin McMillen
660d163119
converted all TODOs into Issues
GitOrigin-RevId: aae80308b3
4 years ago