Skip to content

hunterchen7/typing-game

Repository files navigation

typing-game-libgdx

This is a typing game built with LibGDX, generated with gdx-liftoff using OpenJDK 21.0.2.

demo

Users can play 30 levels of varying difficulty containing thousands of unique words, while competing for a spot on the leaderboard.

User, level and score data are all stored in a SQLite database.

Demo video: https://www.youtube.com/watch?v=1PN8l_tNcNQ

This project was generated with a template including simple application launchers and an ApplicationAdapter extension that draws libGDX logo.

Development setup guide

  1. Install JDK 21
  2. Clone repository
  3. Open project in IntelliJ
  4. Run/Debug Lwjgl3Launcher.java
  5. Alternatively configure as an application using OpenJDK 21, classpath = group9.lwjgl3.main and main method = com.cs2212group9.typinggame.lwjgl3.Lwjgl3Launcher
  • Most pages are configured with hot-reload: use Ctrl + F9 to recompile and Ctrl + Shift + F5 to reload the page
  • To modify level generation, Python is required

Build guide

  • Run ./build.sh to build the project with pre-existing user data
  • Run ./build.sh -f to build the project with a fresh database
  • Alternatively, use ./build.bat if bash not available
  • Both will build to lwjgl3/build/libs/, run the game with typing-game-libgdx-x.x.x.jar
  • using ./gradlew lwjgl3:jar will build the project, but will not copy the database, so it will not work
  • Python is NOT required to build the project, but is used for level generation, Python 3.11 was used.

Testing

  • Run tests by configuring JUnit in IntelliJ to run all in package com.cs2212group9.typinggame

Instructor Mode

  • To log in as an instructor/admin, use the username admin. The password is the same as the username.
  • As an instructor, you see the same scoreboard as everyone else, but you have an additional search function.
  • It allows you to search for users by username, and view their scores and number of attempts on each level.

Platforms

  • core: Main module with the application logic shared by all platforms.
  • lwjgl3: Primary desktop platform using LWJGL3.

Gradle

This project uses Gradle to manage dependencies. The Gradle wrapper was included, so you can run Gradle tasks using gradlew.bat or ./gradlew commands. Useful Gradle tasks and flags:

  • --continue: when using this flag, errors will not stop the tasks from running.
  • --daemon: thanks to this flag, Gradle daemon will be used to run chosen tasks.
  • --offline: when using this flag, cached dependency archives will be used.
  • --refresh-dependencies: this flag forces validation of all dependencies. Useful for snapshot versions.
  • build: builds sources and archives of every project.
  • cleanEclipse: removes Eclipse project data.
  • cleanIdea: removes IntelliJ project data.
  • clean: removes build folders, which store compiled classes and built archives.
  • eclipse: generates Eclipse project data.
  • idea: generates IntelliJ project data.
  • lwjgl3:jar: builds application's runnable jar, which can be found at lwjgl3/build/lib.
  • lwjgl3:run: starts the application.
  • test: runs unit tests (if any).

Note that most tasks that are not specific to a single project can be run with name: prefix, where the name should be replaced with the ID of a specific project. For example, core:clean removes build folder only from the core project.

Credits

About

A typing game built with LibGDX

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages