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
Colin McMillen
f0630d1679
go back to just a single RenderTarget
GitOrigin-RevId: 0b8fc30900
4 years ago
Colin McMillen
d75a469acc
Move JumpyGame -> SneakGame & fix references
GitOrigin-RevId: ec99138000
4 years ago
Colin McMillen
096f577e61
change namespace to SemiColinGames
GitOrigin-RevId: 3c4e116e77
4 years ago
Colin McMillen
569a330e89
move Jumpy.Shared -> Shared directory
GitOrigin-RevId: 781f1fb42b
4 years ago
Colin McMillen
37e3a8baba
add keyboard controls for Player & toggling debug info
GitOrigin-RevId: 0ab5e52485
4 years ago
Colin McMillen
7ed88960a5
gate toasts behind Debug.Enabled, rearrange their position & color
GitOrigin-RevId: 4efcd95c30
4 years ago
Colin McMillen
010424f43f
anchor the background images at the top
GitOrigin-RevId: caa4dc0ec3
4 years ago
Colin McMillen
22db0ee696
basic scrolling world!
GitOrigin-RevId: 6c08535f1a
4 years ago
Colin McMillen
67e952d64f
only draw FPS when debug enabled
GitOrigin-RevId: 22783521cb
4 years ago
Colin McMillen
1c7e058cb9
rm spurious printout
GitOrigin-RevId: 46f378f289
4 years ago
Colin McMillen
6c5c7d4992
add Debug class for displaying rects on-screen
use it to display bounding boxes of player & obstacles
GitOrigin-RevId: 1354637c8a
5 years ago
Colin McMillen
9c8f8b70df
enumerate and show collision targets
GitOrigin-RevId: d8cb888e4e
5 years ago
Colin McMillen
fb2d0e8a6d
add World class & refactor other things appropriately
GitOrigin-RevId: 9e72fe9527
5 years ago
Colin McMillen
3af02981c4
add rock-y ground tiles
GitOrigin-RevId: fd490a5a2c
5 years ago
Colin McMillen
9ed2021039
add background layers
GitOrigin-RevId: 93a5c7e147
5 years ago
Colin McMillen
1fbcacecfc
add ground texture
GitOrigin-RevId: 2313a9c038
5 years ago
Colin McMillen
7fe248aecc
refactor uses of gamepad / keyboard history
GitOrigin-RevId: ee4d881cb0
5 years ago
Colin McMillen
307efa5f5b
use History for handling gamepad & keyboard state
GitOrigin-RevId: 87aa91b212
5 years ago
Colin McMillen
df6cee8df1
partial work toward keeping multiple render targets around for GIF encoding
GitOrigin-RevId: 8061896562
5 years ago
Colin McMillen
80b6e2ac5c
FpsCounter now returns an int (rounded up)
rename gameTime -> time in Player
GitOrigin-RevId: 0270c026e6
5 years ago