Coder Social home page Coder Social logo

sogomn-engine's Introduction

Simple pure Java game engine

Creative name, eh?


Motivation

I initially made this to save some coding time. I used to start a new project and dump the old one every week. Hence I had to write all the basic stuff over and over again. That made me create a library for games.

It is made with only the standard Java API and thus highly portable.


Example
final Clock gameClock = new Clock();
final Screen screen = new Screen(800, 600, "My game");
    
gameClock.addListener(delta -> {
	System.out.println("Game is updating!");
	System.out.println("Delta time: " + delta);
});
    
screen.addListener(graphics -> {
	graphics.setColor(Color.RED);
	graphics.drawString("Awesome text on the screen", 50, 50);
});
screen.show();
    
while (screen.isOpen()) {
	gameClock.update();
	screen.redraw();
}

There is a more detailed example over here.


Note!

If running an application in full screen mode I recommend you to restrict the drawing rate.
Full screen caps the frame rate at 60 on most devices and thus makes the update chain lag.
Also you need to handle synchronization with the event queue yourself.

If you need help or want to give feedback, hit me up on my Twitter @TheRealSogomn!

sogomn-engine's People

Contributors

sogomn avatar

Watchers

James Cloos avatar Kinesis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.