Skip to content

slipslop/JavaGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaGame

First larger game made with Java.

Controls:

  • WASD movement
  • Mouse aim and click to shoot.
  • P to pause, U to unpause, L for godmode, G to reset ammos (obviously some of these has to be removed from final version)

Functionalities:

  • Notch's game loop (creator of Minecraft) ticks every game obect 60 times/s
  • Player following camera
  • 2 levels

New ideas learned from this project

  • Every object is loaded to a LinkedList that accepts type of data.
  • Camera that follows the player
    • First time I looked this up it felt quite a fancy and hard-to-develop system.
    • But after research and guides it was very simple to implement.
    • Pseudo code as follows:
      • Determine what object you want the camera to follow
      • Pass the wanted object's X and Y coordinate to the Camera.
      • Update the camera (give new X and Y coordinates as the object moves)
  • All the objects in the game are created from an abstract GameObject class.
    • This class provides the 'bones' of every game object.
  • Every game object has ID which is an enum class.

Things to improve

  • Better sprite animation.
  • Put classes to packages.

About

First larger game made with Java.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages