Giter VIP home page Giter VIP logo

celeste-classic-pico-8-android's Introduction

Celeste-Classic-PICO-8-Android

This is a step-by-step tutorial to use your PICO-8 cartridges on your Android phone, let's begin shall we?

using google translate

At the beginning of the year I started using PICO-8 when I found out that Celeste was born from such a simple concept. The first thing I could discover using PICO is that you can export to html...

if you can use HTML you can visualize it directly on Android using a tool called WebView.

This is a step-by-step tutorial to use your PICO-8 cartridges on your Android phone, let's begin shall we?

What do we need:

Now we need to understand what we are going to do:

  1. create an application on Android (the classic helloworld: https://developer.android.com/training/basics/firstapp/).
  2. Add the WebView tool to your app (https://jgvcodigo.blogspot.com/2017/12/webview-android.html).
  3. Add the controls on the html file of your cartridge. You can use the following template and call your .js file:

https://github.com/headjump/pico8_html_template (awesome morningtoast post: https://www.lexaloffle.com/bbs/?tid=30147)

4)Finally add your html and js file inside your android project: C: \ Users \ AndroidStudioProjects \ YOUR_PROYECT \ app \ src \ main \ assets

This is the line that made the magic: myWebView.loadUrl("file:///android_asset/YOUR_GAME.html"); This line sends your html.

MainActivity.java


package com..;
import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.webkit.WebView;


public class MainActivity extends AppCompatActivity {

    @Override    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);        setContentView(R.layout.activity_main);
        WebView myWebView = (WebView) this.findViewById(R.id.webView);
        myWebView.loadUrl("file:///android_asset/YOUR_GAME.html");
    }
}

alt text

So as you can see we are calling a simple html on android to be able to show our game. It seems the easiest way to have your first android application working.

And you don´t need as much knowledge to publish your Pico-8 game on Google play.

I leave my code so you can steal it ...

ko-fi

It has a couple of extra lines such as having ads or integrated purchases.

Let me know what you think!!!!!!

https://play.google.com/store/apps/details?id=com.demilion.a20

celeste-classic-pico-8-android's People

Contributors

demilion avatar

Watchers

 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.