983a02b364
remove old Levels file
2020-03-08 17:28:45 -04:00
5121f6d775
World: load levels by parsing a JSON level description.
2020-03-08 17:23:51 -04:00
28ef337691
make field readonly
2020-03-07 12:40:21 -05:00
0a37453dbd
switch to sourcing all tiles from Grassland
2020-03-06 19:01:48 -05:00
392495a61e
remove unneeded timeInState calc & redundant "string?" annotation
2020-03-06 14:20:17 -05:00
0f8d9c2814
FSM / Player / NPCs now get World as an argument to Update()
2020-03-06 12:28:58 -05:00
1b124f84df
FSM now takes a type parameter so that we can use FSM with other classes.
2020-03-06 12:16:33 -05:00
08091106ea
Terrain: use optional arguments for IsObstacle / IsHarmful
2020-03-06 12:02:41 -05:00
b2583677bf
Terrain now takes an IsHarmful param in constructor.
2020-03-06 11:44:43 -05:00
f756780660
NPCs should start in "run" state.
2020-03-06 11:44:19 -05:00
b574a5a702
change Sprite / Animation times to double (sec) instead of int (ms).
2020-03-05 21:12:11 -05:00
53083818c0
Add a TODO and fix a smol cleanup.
2020-03-05 17:39:30 -05:00
3c4e63ada0
Add basic FSM & use it from NPC.
2020-03-05 17:39:17 -05:00
53c6d8483f
include multiple NPCs, have them turn around based on platforms.
2020-03-05 16:17:57 -05:00
5b82f4d646
handle PingPong animations
2020-03-05 15:55:40 -05:00
0b8eb3e3f1
Player: start using Sprite data to calculate texture source / animations.
2020-03-05 15:28:34 -05:00
654bb7fe97
load JSON files directly instead of embedding in XML.
2020-03-04 16:16:41 -05:00
9672fabcfd
Add Sprite class & load sprite metadata from JSON.
2020-03-03 17:14:05 -05:00
4299a009b7
use auto property
2020-03-03 13:08:51 -05:00
d270efe643
move Player into World
2020-03-03 13:04:29 -05:00
f801f95551
move to a root LICENSE.txt
2020-03-02 20:46:44 -05:00
65fe870a9a
let Scene decide when to draw itself & when to play music
...
GitOrigin-RevId: 0eac6682b0bbe4d436707c44d9685c1e518b8295
2020-03-02 16:47:42 -05:00
29cf5eb0c9
add short music loop to demo stage
...
GitOrigin-RevId: 7ea3d773b12341eb3eb3aabd9000cc32014faac8
2020-03-02 15:33:56 -05:00
02b1dd4874
Add simple NPC.
...
GitOrigin-RevId: 47cd7abaf80d7ced14d0b4b92390c8c0edddae1c
2020-02-28 17:13:52 -05:00
d9e9fcf9a2
remove trailing whitespace
...
GitOrigin-RevId: 4ccd727a7921e8ef08296586283d84bdc6f31c99
2020-02-27 20:24:40 -05:00
de8ca4a374
Add sword-swing sound effects.
...
GitOrigin-RevId: 946a808c6f7e96297ec291f2b8e55ae062d5193b
2020-02-27 20:24:36 -05:00
f4581ecaf8
Player now takes damage from spikes.
...
GitOrigin-RevId: e9096316218f2590aac74ce1055a0829f71bdff8
2020-02-27 19:13:59 -05:00
a431ad094b
smush hearts together a smidge
...
GitOrigin-RevId: ebb0e78ff5f3c51d6ddc9765e38fb262bccee160
2020-02-27 16:50:19 -05:00
c189cfcc09
Add player health & a heart sprite.
...
GitOrigin-RevId: 3389f46044a3fbb48af8533370c0318982c9ad83
2020-02-27 16:28:48 -05:00
c213009134
Add Text.DrawOutlined() function & other text helpers.
...
GitOrigin-RevId: 47f9115767c9acac31edaed13ba0ac62732a27f1
2020-02-27 15:46:54 -05:00
830fc1ee9a
set font to be PointClamped
...
GitOrigin-RevId: 6f21d2f11df5ba30061ca2994988f5bbd5d38b1d
2020-02-27 11:54:37 -05:00
c2fa12db9b
Stop printing out jumpTime.
...
GitOrigin-RevId: dc062283389545c0dd55a3438cc192c2d449ef9a
2020-02-26 17:59:09 -05:00
f8fa66385d
Display "Paused" message when paused.
...
Add a new "Banner" style font for the pause message.
GitOrigin-RevId: 62f9537574351b961d7a2bd74f12e218f1047062
2020-02-26 17:44:36 -05:00
5549f15029
rename numEdgeVertices -> NUM_EDGE_VERTICES
...
GitOrigin-RevId: c7a67e06ea330f1fd3de4abdbeb8021402b6f330
2020-02-25 20:34:49 -05:00
3a8defcf3f
Letterbox the scene if the aspect ratio is out-of-whack.
...
Fixes #23 .
GitOrigin-RevId: 2da580115e44f2658e7f9b9d3d39a366d3a1bbfd
2020-02-25 20:24:19 -05:00
0a64d17db5
fix lint errors
...
GitOrigin-RevId: 5de396b25947e1de5bea55ecc32bacc59e5b336d
2020-02-25 19:19:10 -05:00
bd78586a1d
rm newline
...
GitOrigin-RevId: c369e8bd9f847a038c544db1094ba1aabbcf388d
2020-02-25 10:30:57 -05:00
74b5e1ec2d
Debug rects: pull in top & left sides by a 1-pixel margin.
...
GitOrigin-RevId: 0f1f846e3f9251699917c43241efe73d6ba74849
2020-02-25 09:58:42 -05:00
a0ea63f96b
make Input readonly
...
GitOrigin-RevId: 1bb3c6bb6fad236b0b974a78b2d0c75474c9fa23
2020-02-25 09:35:59 -05:00
4e4c2cccb3
Input: process debugging commands first & exit early if any are pressed.
...
GitOrigin-RevId: c36acce59305a0f2086b88c6206f73e3860e0c51
2020-02-25 09:26:28 -05:00
6802b3f162
Make separate ExtensionMethods file.
...
Add Point-deconstruction as an extension method.
GitOrigin-RevId: a804ba797a9b939b65652df67987628b1742dad6
2020-02-24 20:46:24 -05:00
f081a3db4e
Apply VS suggestion for refactoring TextureRef.Get
...
GitOrigin-RevId: 9758a333c456f6a150282d3f4adb00c68095e416
2020-02-24 17:07:42 -05:00
26649ce20d
Draw debug output within the TV-safe area.
...
Details here:
https://docs.microsoft.com/en-us/windows/uwp/design/devices/designing-for-tv#tv-safe-area
GitOrigin-RevId: 6bd4e9805a078f6b21cc40fc633c36cde371b6e6
2020-02-21 10:24:31 -05:00
ed7afd2fa1
TextureRef: make Get a property rather than a function
...
GitOrigin-RevId: a36369c33b0c23859768c7bd7b1548b7d834cbb3
2020-02-20 16:39:38 -05:00
e72b8999e4
Make TextureRef class for holding textures.
...
Use it in World so that all Terrain-specific configuration can be specified in
one place.
GitOrigin-RevId: 31acf292ae6e438f609a7396e78555e1db9b744e
2020-02-20 16:37:52 -05:00
0e164f7b75
mark field readonly
...
GitOrigin-RevId: 9e06f8a03a69c18da9e4828263eed65b13776904
2020-02-20 16:37:48 -05:00
0ee671c8b1
fix how the first line of World is parsed
...
GitOrigin-RevId: 9409e491fd04067af750333b693d0f992bf6315d
2020-02-20 13:37:32 -05:00
c4e211e750
more level decorations
...
GitOrigin-RevId: b6446a7451f877fc7c46a35a49d450dd1f3b9c26
2020-02-20 13:37:28 -05:00
f1b71ca87d
Tiles can now be obstacles (in the foreground) or decorations (in the background).
...
Updated Levels to show off some of these.
GitOrigin-RevId: d8d04410c15dd36218d5a1504dd842827082180f
2020-02-20 12:26:47 -05:00
08a31231e9
Draw LinesOfSight behind most other things.
...
Also remove the currently-unneeded lightingTarget.
GitOrigin-RevId: 95d96d966a07624b2c6c648d7c208cfa16acd2b9
2020-02-19 17:33:44 -05:00
2fe8e53e77
Call GC.SuppressFinalize() from Dispose().
...
GitOrigin-RevId: 57b1d3760a781966e3dd673970b535bb8cade1a2
2020-02-19 17:18:25 -05:00
af9a48bc5d
small cleanups suggested by VS
...
GitOrigin-RevId: b1b3a687e399f0672a436c6542914143adaea6bb
2020-02-19 16:36:51 -05:00
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: 0640cced784e6bf5ee15f4edce8bf11d122dac51
2020-02-19 16:33:32 -05:00
1eb4d7a7d2
Debug off by default
...
GitOrigin-RevId: 0e0325057b0b6fad5b11a2072dd6bb14643b7847
2020-02-19 15:34:28 -05:00
44bd3c6896
Show lines of sight only when Debug enabled
...
GitOrigin-RevId: 77de51cce5e9e6a009a866e0eb5bc213f00b176c
2020-02-19 15:09:03 -05:00
b858c45b7e
Cycle through levels when player hits the "restart level" button.
...
GitOrigin-RevId: bbe909515fbc4b61be3357e506a113e82bb6e2bd
2020-02-19 15:07:55 -05:00
6b9aa0844c
Update demo level.
...
GitOrigin-RevId: 90064478fe88d5dc7ade74ac2417012c16e639fa
2020-02-19 15:07:52 -05:00
0df153581c
Add new terrain types to World
...
GitOrigin-RevId: ab811a1b52ea011a7acea078ec6e78735a298d59
2020-02-19 15:07:48 -05:00
b06155aa88
Render backgrounds from back-to-front in an array.
...
GitOrigin-RevId: 1f4ca760d4dc4a73a4f96f6b04ee2929e789a5eb
2020-02-19 15:07:44 -05:00
cf5167fba7
Player: tweak constants, track jump hangtime.
...
GitOrigin-RevId: 868003a32664b89212cdb4cf082d96016c5529f9
2020-02-19 15:07:40 -05:00
90b003e0b0
Change Debug button from left shoulder to Select.
...
GitOrigin-RevId: 7e633c9904572c0f88859f2929ee5743ae2f3261
2020-02-19 15:07:36 -05:00
05638483a4
Support 4-layer parallax-scrolling backgrounds.
...
GitOrigin-RevId: 58c1d1fee99e56dd656af5bbf628fbdc16d55e14
2020-02-19 13:07:58 -05:00
8405f32f3c
simplify lightingEffect initialization
...
GitOrigin-RevId: 28ca3d2336fe78f152aff2b810e90dc06e7816b6
2020-02-19 11:24:56 -05:00
57d15cbbd9
Load all textures & fonts in one place.
...
GitOrigin-RevId: 076c86b24f4e4e314a52457a01d5c77e197a2fa2
2020-02-19 11:20:20 -05:00
8f5514b776
More refactoring of Tile loading.
...
GitOrigin-RevId: 96a697bc78cdaefc874b9eb7b9d4cca28efe27f2
2020-02-18 16:50:47 -05:00
2934296649
Refactor tile creation to support assets from multiple tilesets.
...
GitOrigin-RevId: 9863c368214536e09009e27dcb68b8d42f3d04f0
2020-02-18 15:24:49 -05:00
02aba3ad84
Game objects now take in a ContentManager & load their own textures.
...
GitOrigin-RevId: 4f40548d9f100f4bad181a59f4df44397f7ccf76
2020-02-18 13:58:04 -05:00
f0ea8d8ef2
Reorganize Content/ into multiple subdirectories.
...
Add new tilesets from anokolisa.
GitOrigin-RevId: 90cfd52a3c374beff7c1b8d07899e822bdf2e541
2020-02-18 10:30:05 -05:00
9eeede2310
Shared.shproj: remove redundant & out-of-date file listings
...
GitOrigin-RevId: e7cc4d730faa5bc22a6aae55df53d55c6e44b41a
2020-02-17 21:22:16 -05:00
7935b6aaff
Scene: go back to drawing Player behind tiles.
...
GitOrigin-RevId: afaff144f2af1f0ebcaf5b640cb621413110f380
2020-02-17 21:22:12 -05:00
7e7b0f7715
Move most of the drawing code into a Scene class
...
GitOrigin-RevId: 4515493a3bbf99b9513f2f1e66acadae1df53a5a
2020-02-17 21:08:32 -05:00
43f6bded70
draw backgrounds as partially transparent
...
GitOrigin-RevId: b570a9aab75d18e6f7778dc851537794f30d801a
2020-02-17 19:59:52 -05:00
786b230a6c
LinesOfSight: don't draw yellow lines
...
GitOrigin-RevId: 1ebd5fe922856036d814a129520a5f3d6e1e4447
2020-02-16 19:44:36 -05:00
e2ea2e1d3f
Add ability to restart the level. Fixes #9 .
...
GitOrigin-RevId: e7a0cdcdded50e2f02067a166a33e18504aac344
2020-02-16 19:22:36 -05:00
1ffe1444b2
Debug: draw rects as 4 GPU-accelerated lines.
...
GitOrigin-RevId: 3286d0476b5032d785f74191609db4fbd768433c
2020-02-15 16:32:39 -05:00
48a9297a57
draw Debug stuff on top of everything (after lighting)
...
GitOrigin-RevId: e07fbc6b27af23912de1344a1bc3788ef69fd9c5
2020-02-15 16:32:34 -05:00
5d21ff2a0f
Debug.DrawLines: use GPU to draw lines.
...
Fixes #19 .
GitOrigin-RevId: d837e0ddafa0b7ea66fea4bba05ca7412a3c5726
2020-02-15 15:47:45 -05:00
a21802e9f2
FMath.DegToRad(): use look-up table.
...
GitOrigin-RevId: 2dab2e175cf99448595304eeb7593bf499485273
2020-02-15 15:15:24 -05:00
24078d6c62
move FieldOfView into Player
...
GitOrigin-RevId: 6d6a4094533819b11deebd5319616b5f5ed68948
2020-02-15 15:00:26 -05:00
66f895fab8
Player: remove GetPose, add VisionRange and VisionRay.
...
Fixes #21 .
GitOrigin-RevId: 720972d1c8bd989edc38289f2e66e91290cf0134
2020-02-15 14:57:21 -05:00
c94ae6eb25
Player: make Facing an int property.
...
Partial work toward #21 .
GitOrigin-RevId: 902c46d19abb7c1a2c3a2aa3bfb344d52fa6a970
2020-02-15 14:49:35 -05:00
4d64d6fa12
Initialize and dispose of whiteTexture in SneakGame.
...
Fixes #7 .
GitOrigin-RevId: 024688e8fc8ed28950147baefc2fda2005e6aced
2020-02-13 18:36:48 -05:00
257a74ca58
LinesOfSight: use less-deprecated DrawIndexedPrimitives() call.
...
GitOrigin-RevId: 87d9482de392dfc659cc5c7e8fa354e9b6941425
2020-02-13 16:05:05 -05:00
23278334b0
use DrawIndexedPrimitives; fixes #41
...
GitOrigin-RevId: 6cc7429d0b69ace6da4f965af6f70fff2f1e139b
2020-02-13 14:55:22 -05:00
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: 0e769d3288dce17fe174b2a1d82a99b1d9994213
2020-02-13 14:55:18 -05:00
5b7c0dd888
move LinesOfSight into its own file
...
GitOrigin-RevId: 21a722cc9d31abf0f5d33cccebb82d7786e45fde
2020-02-13 14:55:14 -05:00
93a5d477bb
New FOV algorithm that works pretty well.
...
Saved for posterity here, approximately:
https://twitter.com/mcmillen/status/1227326054949408768
GitOrigin-RevId: e960dad1d9241c08dbf1292c6856311d4ebd7a85
2020-02-13 14:55:02 -05:00
7cc953a44e
add extension method: Vector2.Rotate()
...
GitOrigin-RevId: ee1e84ff188d5a3134dafb1f5150199682c4e063
2020-02-13 14:54:58 -05:00
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: afab72c39236b1b46fe1597412209981ddae9c7c
2020-02-13 14:54:46 -05:00
6b9890b6f7
Player: more line-of-sight debug lines
...
GitOrigin-RevId: 655eef228659215ce53ac3e58bc324581a0fec3f
2020-02-13 14:54:42 -05:00
80746ecaed
Use world definition from Levels file
...
GitOrigin-RevId: a5d19f4f0828bb52989b12590d6e364d0edd918b
2020-02-13 14:54:38 -05:00
d30be7a460
Timer: don't automatically DumpStats(); refactor string prefixes during dump
...
GitOrigin-RevId: 93b7d652823785b2be1074af50dbe4952e288856
2020-02-13 14:54:34 -05:00
5672e292cc
add Levels file to hold level definitions (for now)
...
GitOrigin-RevId: ba9c09158f615844be53a1c294d7b8d88c9a62e2
2020-02-13 14:54:30 -05:00
2d2a3fde7d
Timer formatting: change 200%+ to 200+%
...
GitOrigin-RevId: d04c35760d8e05404fda01c0adac8a5c465423b7
2020-02-13 14:54:26 -05:00
80f1104d82
Timer: better histogram formatting. bin into 10% intervals instead of 5%
...
GitOrigin-RevId: 9729f04bd650e530d6e60efbed348d6269608f16
2020-02-13 14:54:22 -05:00
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: 5df31be3710457c7a8dae38b0b61c5dc50e3c54c
2020-02-13 14:54:18 -05:00
0f9d546398
make Clamp() generic across comparables and move it into FMath.
...
GitOrigin-RevId: 4ed26cc24dd204813540bde36889a17c20ad007b
2020-02-13 14:54:14 -05:00
bf2f33f698
add Timer class to projitems
...
related to issue #33
GitOrigin-RevId: 2870974cfb34ec14a754d6fcdc976fc7e3fb126c
2020-02-13 14:54:10 -05:00
36ebeadddf
add Timer class for tracking draw & update times (etc)
...
related issue: #33
GitOrigin-RevId: 3762a7a5c7becf83cc50f80d4e5bb6f27244a952
2020-02-13 14:54:06 -05:00
d44ac76d49
fix cones-of-sight tilting in the wrong up/down direction when facing left
...
GitOrigin-RevId: 6b4925c75f44069af84685bc749a3586ad376e1d
2020-02-13 14:54:02 -05:00