Git Product home page Git Product logo

lunargdx's Introduction

Lunar

What is Lunar?

Lunar is a networking library for LibGDX. With lunar you can easily create multiplayer games quickly and efficiently. Lunar provides many common utilities such as entities, worlds, protocol, and box2d support!

Lunar is still very early, so please be nice :)

Actual Game Demo

https://github.com/Vrekt/OasisGame

Features

  • Player and entity renderers with animation loading.
  • Partially Networked Box2d worlds.
  • Networked player moving and velocity.
  • Networked player creation/removing.
  • Game lobbies and worlds.
  • Basic entity support
  • A expandable protocol with SSL support.
  • Very customizable and extendable.

Get A Taste

// apply force to another player and send it to others since they were attacked.
this.player.getWorldIn().applyForceToOtherPlayerNetwork(somePlayer, player.getConnection(), fx, fy, px, py, true);

// apply a knock-back force to ourselves.
this.player.getWorldIn().applyForceToPlayerNetwork(player.getConnection(), fx, fy, point.x, point.y, true);
// register a unique custom packet.
this.connection.registerPacket(99, MyCustomPacket::new, packet -> handleEntityPropertiesPacket(packet));
// Create a networked world for others to join us.
// We tell the world to handle physics updates and local player updates for us.
lunarWorld = new BasicLunarWorld(player, world, scaling, true, true, true);
// Spawn our player in the world.
player.spawnEntityInWorld(lunarWorld, 2.0f, 2.0f);
// connect to remote server.
final LunarClientServer server = new LunarClientServer(lunar, "localhost", 6969);
server.connect().join();

// get our connection
final PlayerConnection connection = (PlayerConnection) server.getConnection();

Want to jump in? Check out the Building A Simple Game

Documentation and Examples

Examples

Wiki

Planned Features

  • Networked collision
  • Better movement sync.
  • Better protocol security.
  • Networked entities and other map/world objects.
  • ...

Known Issues

  • Random ghost player blinks next to networked player
  • Initial position seems to be de-synced some way
  • Worlds will need to be disposed when switching between them
  • probably other stuff I don't know about.

Using Lunar

You can find releases in the releases section. Both client and server rely on the Protocol dependency.

You must also add a dependency for netty-all.

Gradle 6.7.2
implementation group: 'io.netty', name: 'netty-all', version: '4.1.48.Final'

lunargdx's People

Contributors

vrekt 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.