Giter Site home page Giter Site logo

haroldo-ok / bitsy-converter Goto Github PK

View Code? Open in Web Editor NEW
13.0 4.0 3.0 3.35 MB

Online tool for converting bitsy scripts into various formats

Home Page: https://haroldo-ok.itch.io/bitsy-converter

License: MIT License

HTML 0.90% CSS 1.91% JavaScript 60.71% C++ 10.25% C 26.23%

bitsy-converter's Introduction

Bitsy-Converter

This tool allows one to convert Bitsy scripts into various output formats:

  • JSON: fully supported;
  • Arduboy source code;
  • SDCC + LibCV, which can be compiled into ColecoVision, SG-1000, Sega Master System and MSX ROMS;
  • More formats will come later.

For now, both the Arduboy and LibCV will only support dialogs if they are simple; full dialog support is intended to come in the future.

All you have to do is paste the script on the left panel, and the converted result will be displayed on the right panel; you can alternate between JSON, Arduboy and LibCV formats by clicking on the tabs on the top of the right panel.

This project was bootstrapped with Create React App.

bitsy-converter's People

Contributors

dependabot[bot] avatar haroldo-ok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bitsy-converter's Issues

Refactor the Arduboy code generator

  • Refactor the code generation so that it can later be used for other targets:
    • Create some quick-and-dirty unit tests to ensure nothing is broken during refactor;
    • Move the initial data preparation to its own source file;
    • Functions that generate generic C code should be moved to a separate source file;
    • Functions that generate generic C++ code should be moved to a separate source file;
    • Merge everything to master.

Give it the ability to directly import from existing packaged Bitsy games.

RomanSHoje às 11:05
it's a real problem to cut the code right way for convertation. i do it but the game does not work properly ) i believe that automatic cut and conversion is a solution ) if we could put the link to the game and get the converted code in LGE IDE it's the best way to get the playable bitsy game!

Implement support for ESP Little Game Engine

  • Implement support for ESP Little Game Engine:
    • Study a few of the example sources;
    • Check out how the image data is structured;
    • Implement a proof of concept;
      • Convert the image data into something the engine can use;
      • Display at least one of the sprites;
      • Display the room on the screen;
      • Create data structures for the sprites;
      • Display sprites on the screen;
      • Make the player controllable;
      • Make the player interact with sprites;
      • Implement data structures for animation;
      • Implement background animation;
      • Implement sprite animation;
      • Implement collision against the background;
      • Implement exits;
      • Implement endings;
      • Implement title screen;
      • Discard unused code an data.
    • Implement the code generator:
      • The compiler is case-insensitive, which can cause problems when generating code; one way to preventing problems would be to implement a pre-processing step that would automatically rename a bunch of things from the Bitsy object so that they will stay unique even on a case-insensitive language;
      • Implement code generation based on both the preprocessed object and the proof-of-concept (develop the unit tests in tandem):
        • Generate image offset constants;
        • Generate dialog id constants;
        • Generate ending id constants;
        • Generate game title constant;
        • Generate sprite arrays;
        • Generate exit arrays;
        • Generate ending arrays;
        • Generate room arrays;
        • Generate tile info array;
        • Generate image arrays;
        • Generate dialog functions;
        • Generate ending functions;
        • Generate the rest of the source template;
        • Delete unused functions from the generator;
      • Make the UI call the code generator;
      • Correct the errors pointed out by the ESP-LGE compiler:
        • Don't use the const keyword;
        • Don't use the uint8_t type;
        • Don't declare empty arrays;
        • Some constants are missing from the generated code, such as ROOM_REC_SIZE;
        • Test again against the compiler.
    • Generate the release
      • Release on GitHub;
      • Release on itchio;
      • Notify on ESP's Discord.

Test it with older Bitsy scripts

As per torabora's report it seems to fail when importing older Bitsy scripts:

@haroldo-ok with which version of bitsy in a game the converter can convert a code to esp-lge? I have tried games with # BITSY VERSION 4.8, 5.1 and 6.0. Only 6.0 was abled to convert to lge (The Midnight Bakery) but with errors

Pasting Only Works with JSON

I'm trying to use the converter to convert games to LIBCV without success. Here are the steps:

Copy Bitsy code from Bitsy
Open Bitsy Converter
Select JSON
Paste Code
This works - I get my code converted to JSON

But I'm unable to select the other three options to convert the code after this. The tabs just flash but nothing changes.

Then I try
Reset Bitsy Converter
Select LIBCV in Bitsy Converter
Attempt to Paste Code (doesn't work)
Attempt to delete code in left hand side of converter (only able to delete a few lines)

I am testing this in the following browsers: (On the Mac) Safari, Chrome, Firefox. (On Windows 10) Default Windows Browser (edge)

Attached is the code for my game.
welcome_to_enduro_death_race_tur.bitsy.zip

Import support for SDCC + LibCV

  • Implement generation of C code compatible with the version of LibCV supported by '8bitworkshop'
    • Do an initial manual data structure conversion of the structures used by the Arduboy generator;
    • Using the data structures, create the required C code for using the game on LibCV;
      • Load the tiles;
      • Display the background;
      • Display the sprites;
      • Use joypad input to move around;
      • Animate tiles;
      • Collide with background;
      • Interact with sprites;
      • Make the room exits work;
      • Implement title screen and ending;
      • Cleanup the code;
    • Based on the above proof-of-concept, make the converter generate the required data structures:
      • Add placeholder to the GUI;
      • Create unit tests for the required data structures;
      • Implement the generators for the various structures;
      • Put the generator together with the GUI;
      • Some additional manual testing.

Great idea

Hi really liking these retro solutions. Can this work/convert to c64 is there any video links thanks

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.