
Open your terminal, scaffold a new React app named react rogue with create react app, then tidy the project by deleting unnecessary files and verify it runs with npm start.
Learn modern React by building a roguelike canvas component with arrow function syntax and JSX. Create a 256 by 256 canvas with a border and wire it into index.js.
In this React rogue-like lesson, build a player class that draws itself, tracks health, uses tile coordinates for movement, and renders a red at symbol.
Learn how to build an entity base class that the player, monsters, and loot inherit from, with attributes, drawing logic, and ascii symbols, plus a spawner to populate loot.
Create a monster class and a basic roguelike combat loop with health and attack. Remove defeated monsters and log combat events, while spawning new foes from a table.
Wow you got this far, well done!
Below is a link to the finished code just in case you have a pesky bug.
Hope you enjoyed the course, you got this far so you are obviously a genius, ninja coder. Feel good about that and I'll try and make the next course harder ;-)
https://gitlab.com/morganpage/react-rogue
Ever wanted to learn React and Hooks but found traditional courses a little boring & long?
Jump straight in by coding a roguelike game and learn the fun way!
You will get experience using:
React
Hooks
Javascript
ES6
Classes
Arrays
Functions
Objects
Node.js
Coding a roguelike game is a great way to learn the fundamentals of React, Hooks and useful generic game concepts like movement, combat and inventories.
The game includes:
Movement
Input handling
Procedural generation
Collision detection
Inventory
Combat log
I hope you enjoy the course!