MIT License

项目介绍

JohanLi/uncharted-waters-2 是一个托管在 GitHub 上的开源项目,主要使用 TypeScript 编写,采用 MIT License 许可证,目前获得 140 个 Star、42 次 Fork。

仓库全名
JohanLi/uncharted-waters-2
开源许可证
MIT License
Star 数
140
Fork 数
42

README 摘要

Uncharted Waters: New Horizons Uncharted Waters: New Horizons (大航海時代II) is an open world RPG and simulation game from 1994, set during the Age of Exploration. Being the favorite game of my childhood, I’m remaking it using web technologies. This is not meant to be even close to a full remake. I’m a web developer transitioning to doing consulting work — this side project lets prospective employers see my code…

完整内容见 GitHub 原始 README 或本页 。

常见问题

uncharted-waters-2 用什么语言开发?

主要使用 TypeScript 编写,采用 MIT License 许可证,目前有 140 个 Star。

uncharted-waters-2 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 uncharted-waters-2 的源码?

可以直接克隆仓库:git clone https://github.com/JohanLi/uncharted-waters-2.git,默认分支为 main;安装与运行步骤见仓库 README。

uncharted-waters-2 最近还在维护吗?

仓库最近一次更新为 10月3日,当前没有未关闭的 Issue;Star 数为 140,可作为社区活跃度的参考。

关于

Browser-based remake of Uncharted Waters: New Horizons (大航海時代II)

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
233
价值分
97
活跃状态
活跃

语言占比

CSS
HTML
Shell
TypeScript

贡献者

README

Uncharted Waters: New Horizons

tests

Uncharted Waters: New Horizons (大航海時代II) is an open world RPG and simulation game from 1994, set during the Age of Exploration. Being the favorite game of my childhood, I’m remaking it using web technologies.

This is not meant to be even close to a full remake. I’m a web developer transitioning to doing consulting work — this side project lets prospective employers see my code.

Uncharted Waters: New Horizons Screenshots of the original game

Features

  • Walking around in any of the 130 ports and entering their buildings.
  • Sailing around the world map, where your speed takes into account all the factors of the original game.

This game can be played at https://johan.li/uncharted-waters-2/.

Next up on the roadmap
  • Markets
    • Trade goods, taking into account price indices.
  • Shipyards
    • Buy and remodel used ships.
  • Pubs
    • Recruit crew.

Architecture

The game is made up of two parts:

  • The game itself, a canvas element
  • An interface/GUI, handled by React

The game loop reads State and Input, and updates the canvas element.

During gameplay, actions are called to update State. Actions themselves can call updateInterface, which wraps React’s useState hooks.

Assets makes sure the images and game data is loaded before the game starts.

Architecture

The two parts maintain their own local state, e.g., keeping track of the active menu item or where the NPCs are in a port. Input can also be handled locally, particularly when it comes to the interface.

Game loop

Uses requestAnimationFrame().

State changes, such as reading Input and translating it to movement, don’t occur every frame — a check is performed to see if enough time has passed. Each frame does, however, interpolate movement for smoother graphics.

Why isn’t a state management library used?

In contrast to most web apps, the game code is imperative. It doesn’t need to react to changes because it’s looped non-stop. While using a single Redux store for both the game and the interface seems to be a clean approach, it’s too slow if we want to maintain 60 fps.

The interface alone is too simple to warrant using Redux.

Future considerations
  • Players need the ability to save and resume: State, and some local state, needs to be serialized and stored in localStorage, on a server, or both.
  • Using a service worker so the game can be played offline.
  • Pathfinding for NPC fleets.

评论

暂无评论