GithubHelp home page GithubHelp logo

adsempere / playdate4j Goto Github PK

View Code? Open in Web Editor NEW

This project forked from am1goo/playdate4j

0.0 0.0 0.0 631 KB

Java framework to create games for Playdate console made by Panic Inc.

License: MIT License

C++ 43.91% C 0.22% Java 52.50% CMake 0.96% Batchfile 2.42%

playdate4j's Introduction

playdate4j

Java framework to create games on Playdate console.
ATTENTION: it is an experimental version, I don't sure that you should to use it in production purposes right now.

What inside?

  • full support of Playdate API
  • pretty good works in Playdate Simulator
  • easy-to-use Localization API for system languages and any others

C API support

=100%= Logging API
=100%= System Menu API
=100%= Time and Date API
=100%= Miscellaneous API
=100%= Audio API
=100%= Display API
=100%= Graphics API
=100%= Video API
=100%= Input API
=100%= Device Auto Lock API
=100%= System Sounds API
=100%= Sprites API
=100%= Sprite Collisions API
BUT
=000%= JSON API (skipped API, package com.google.code.gson would be better)

Let me explain what it looks like:

public class ExampleGameCycle implements GameCycle {

    private Graphics.LCDBitmap playerBitmap;
    private Sprite.LCDSprite player;

    @Override
    public void start() {
        playerBitmap = Graphics.loadBitmap("images/player");
        player = Sprite.newSprite();
        player.setPosition(lcd_columns / 2, lcd_rows / 2);
        player.setImage(playerBitmap, Graphics.LCDBitmapFlip.Unflipped);
        Sprite.addSprite(player);
    }

    @Override
    public void loop() {
        Graphics.clear(Graphics.LCDSolidColor.White);
        int xDir = 0;
        int yDir = 0;
        if (Input.isButton(Input.PDButtons.Up)) {
            yDir--;
        }
        if (Input.isButton(Input.PDButtons.Down)) {
            yDir++;
        }
        if (Input.isButton(Input.PDButtons.Left)) {
            xDir--;
        }
        if (Input.isButton(Input.PDButtons.Right)) {
            xDir++;
        }

        float deltaTime = Game.getDeltaTime();
        float dx = 100 * xDir * deltaTime;
        float dy = 100 * yDir * deltaTime;
        player.moveBy(dx, dy);

        Sprite.updateAndDrawSprites();
    }

    @Override
    public void stop() {
        if (player != null) {
            Sprite.removeSprite(player);
            Sprite.freeSprite(player);
            player = null;
        }
        if (playerBitmap != null) {
            Graphics.freeBitmap(playerBitmap);
            playerBitmap = null;
        }
    }
}

Roadmap

  • full C API coverage
  • well-automated app creation process
  • using Java-to-C code conversion instead of JavaVM on device

Requirements

  • Playdate SDK 2.3.x version or higher from official site
  • g++ compiler, like mingw64
  • Java Development Kit 1.6 version or higher

Contribute

Contribution in any form is very welcome. Bugs, feature requests or feedback can be reported in form of Issues.

playdate4j's People

Contributors

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