Commit Graph

227 Commits

Author SHA1 Message Date
Brendan Porter 2656339def
Refactor escape (#450)
* refactoring escape menu to allow pop back to menu

* refactors escape menu to allow exiting the game

* fixes bug causing player to not be removed on game exit
2020-06-25 10:16:17 -04:00
Tim Sarbin 6dae0097b9
Added npc labels. More mapgen stuff. (#449) 2020-06-25 00:39:09 -04:00
David Carrell 390f6a1234
351 - add progress handle and helper functions to ScreenLoadHandler:OnLoad to provide ability to asynchronously load data and animate the loading screen (#445)
Co-authored-by: carrelda@Davids-MacBook-Pro.local <carrelda@Davids-MacBook-Pro.local>
2020-06-24 18:46:03 -04:00
Natureknight b60465fd6c
render the run button the UI, and allow the user to toggle it with their mouse, in addition to the R key on the keyboard (#400) (#443) 2020-06-24 15:23:38 -04:00
Ziemas 02605227c3
Various map entity reworks (#439)
* Use integer directions for rotating map entities

* Manage composite directly in npc

* Player manages its own composite

* Split up animation mode types

Players, monsters, objects all have their own types

* Clean up AnimatedEntity

* Rename AnimatedEntity -> Object

* Keep the object txt record on hand in Object
2020-06-24 13:49:13 -04:00
Tim Sarbin a24c05efa9
Map generation and test fixes (#430)
* More mapgen updates

* Added east generation

* Added west town generation

* Fixed test errors
2020-06-24 00:04:27 -04:00
Ripolak f729ff6101
Feature/load misc items (#424)
* Add InventoryItemMisc struct

* Add GetMiscItemByCode function

* Implement InventoryItem interface for InventoryItemMisc

* Add rings and amulets to the example items loading.

* Fix Y of LeftHand and RightHand equipment slots.

* Add "Ripolak" name to CONTRIBUTORS

* Remove double item
2020-06-23 15:28:03 -04:00
Ripolak 2332bd7b58
Feature/player equipment ui (#419)
* Add basic EquipmentSlot struct

* Add Load function to EquipmentSlot

* Move EquipmentSlot struct to inventory_grid.go

* Add equipmentSlots arg to ItemGrid struct

* Add basic rendering of equipment slots.

* Change rendering of equipment slots to simply use their static x and y

* Add ChangeEquippedSlot function

* Add initialization to all equipped slots types.

* Fix Y locations of equipment slots

* Move default equipment slots to a genEquipmentSlotsMap function.

* Change Item to item

* Fix coordinates

* Change usage of string to EquippedSlotType when dealing with different slots in rendering.

* Fix import error

* Remove neck example

* Add loading sprites of equipped items.

* Clean code in Inventory rendering

* Clean code in Inventory rendering

* Clean code in Inventory rendering

* Change default items that get rendered.

* Change default items that get rendered.

* Add width and height to EquipementSlot struct

* Fill in width and height to current equipment slots.

* Fix Y setting of equipment slots

* Rename variables for clean code.

* Change handling nil itemSprite to condition instead of loop return.

* Split Render function to 2 functions.

* Add TODO

* Change comment to start with capital I
2020-06-23 14:12:30 -04:00
Maxime Lavigne (malavv) b640385623
Handles Click and Hovers on most game control elements (#413) (#418)
* Handles Click and Hovers on most game control elements.

Creates a new type of "Actionable" which includes most of the bottom
bar elements. Then handles both "Click" and "Hover" into a separate
handler function.

At the moment, hover does nothing but routes correctly. Click logs
the corresponding actionable.

Known issues:
  - Not capturing button press on click (meaning player will move).
  - Basic touch detection, could be a more fancy QuadTree like struct.
  - Since the visual frames used are not just the actionable, the actual
    x, y coordinates of the actionable need to be entered statically. Changes
    in resolution would probably affect this.

* Renaming vars for code consistency and readability
2020-06-23 12:28:05 -04:00
presiyan-ivanov 2835ff4cf1
Improve run/walk/neutral animation handling. Initial parsing of Level… (#372)
* Improve run/walk/neutral animation handling. Initial parsing of LevelDetail records. Support for holding mouse buttons.

- Run/walk/neutral positions now map to a different animation mode(and speed) depending if in or out of town.

- Run/walk toggle which can be activated/deactivated with R key.

- Temporary(and incorrect) loading and mapping for LevelDetails records.

- Zone change label which shows the level name from LevelDetailsRecord when the player enters a different zone.

- Allow holding mouse left/right button to repeatedly generate an action.

* Remove duplicate load of LevelDetails. Replace numbers in zone change logic with their corresponding RegionIdType

* Move zone change check at the correct place

Co-authored-by: Presiyan Ivanov <presiyan-ivanov@users.noreply.github.com>
2020-06-22 15:55:32 -04:00
Haashi 711cae2d69
fix for #358 from recent PRs (#390)
* camera offset for ui panels :

added maprenderer viewport to be aligned left or right

calling alignement on keyPress in game_controls

* check if already aligned

* fix bugs

-forgot to assign alignement
-defaultScreenRect instead of screenRect because of issue mentionned in original comment

* remove config.json and replace go.mod line

* update with new renderer and escape menu
2020-06-22 09:23:56 -04:00
Ziemas 8c50a014ac
Free camera option in single player (#382)
Enable toggling free camera in single player with the freecam console
command.

Handy for looking around while debugging.
2020-06-21 20:46:00 -04:00
William 485e60683b
Escape menu - Keyboard support and minor improvements (#374)
* Handle up/down/enter keys and reset menu on toggle

Signed-off-by: William Claude <w.claude@thebeat.co>

* Add sound when selecting an item

Signed-off-by: William Claude <w.claude@thebeat.co>

* Reorganise code and remove unused things (YAGNI)

Signed-off-by: William Claude <w.claude@thebeat.co>

* Group properties

Signed-off-by: William Claude <w.claude@thebeat.co>

* Use switch statements instead of IFs

Signed-off-by: William Claude <w.claude@thebeat.co>

* Prevent opening the escape menu over hero stats or inventory

Signed-off-by: William Claude <w.claude@thebeat.co>
2020-06-21 18:44:33 -04:00
Tim Sarbin 912aaf044c
Re-tooled rendering engine (#379) 2020-06-21 18:40:37 -04:00
Maxime Lavigne (malavv) 8bdbef60ed
Added Menu on Escape Key Press (#353) (#371)
- New menu in d2player.
 - Added OnMouseMove and Advance to GameControl.
 - Pause the MapEngine when single player.
2020-06-21 16:06:52 -04:00
Haashi afe4a3a25a
camera offset for ui panels : (#369)
* camera offset for ui panels :

added maprenderer viewport to be aligned left or right

calling alignement on keyPress in game_controls

* check if already aligned
2020-06-21 15:26:07 -04:00
Tim Sarbin 2da08884c4
Added multiplayer support (#336) 2020-06-18 14:11:04 -04:00
Tim Sarbin 52f8cd6d0c
Initial work to separate client and server logic (#330)
* Switched to json formatted characters

* Added infrastructure for networking

* Minor updates.

* more updates for map engine/rendering

* More map engine changes and fixes
2020-06-13 18:32:09 -04:00
Robin Eklind ff4f0b0bfa
all: use goimports to format code and fix two minor typos in comments (#326)
Typos located using misspell: https://github.com/client9/misspell

Formatting done using goimports: https://godoc.org/golang.org/x/tools/cmd/goimports
2020-04-11 14:56:47 -04:00
nicholas-eden f6014498ba
Use missile range and subloop (#311)
Turn on blending.  Calculate target using based on range and angle of hero to click.
2020-02-23 03:23:18 -05:00
nicholas-eden bdfdeda67b
Add support for missiles (#308)
* WIP: Add support for missiles

Break AnimatedEntity into two parts to support single and composite animations.  Summon misssiles on right click.

* Break animated entity down further

Move npc only logic to npc struct, reduce duplication in map entities

* Change a bunch of int32s to int
2020-02-22 20:44:30 -05:00
nicholas-eden b957661915 Add panel to contain hero stats (#299)
Left framing with stats panel, bound to 'C' key.
2020-02-08 10:51:11 -05:00
Tim Sarbin 3412c4338c
Added pathfinding and (buggy) collision data. (#285) 2020-02-02 12:46:19 -05:00
Tim Sarbin 6606774ece
Refectoring to reduce code warnings (#283) 2020-02-01 21:51:49 -05:00
Alex Yatskov b5c1f5222d
Move rendering stuff out of d2common into d2render (#281)
* Move rendering stuff out of d2common into d2render

* Remove d2interface
2020-02-01 20:39:28 -05:00
Alex Yatskov 8a547ebf0e
Moving files around to make more sense (#279)
* Prevent input fighting between terminal and other input listeners.

* Moving files around, removing exports

* Add missing line
2020-02-01 18:55:56 -05:00
Tim Sarbin 2461142fbd
Minor changes to project layout (#276)
* Minor changes to reduce interdependencies on modules.
2020-01-31 23:18:11 -05:00