Giter VIP home page Giter VIP logo

bubblephysics-education's Introduction

BubblePhysics-Education

BubblePhysics-Education is a feature in the sandbox-game BubblePhysics which allows you to control the player autonomously using a TCP-Connection.
The game side is part of any version of bubble physics >= 0.8. The feature is available on Linux, Windows and Android.

Installation

The TCP-Functionality is built into BubblePhysics itself so you just need to download/install BubblePhysics from itch.io
Note that you need to use a desktop build because in most browsers, websites aren't able to create TCP-Servers.

If you want to download the library automatically or using curl, here is the direct link to the file: https://raw.githubusercontent.com/zenonet/BubblePhysics-Education/main/BubblePhysics.py

Python Library

To make it easier, you can use a Python-Library that automatically connects to the TCP-Server and allows for easy control over the game. The library is a single python file, which you can find here.
It isn't on pip right now, so just copy the file to the folder where you have your so

Quick Start

To start automating BubblePhysics, follow these steps:

  • Download a desktop build of BubblePhysics (min version 0.8)
  • Start a game of BubblePhysics (preferably sandbox mode)
  • Go into the pause menu (ESC)
  • Click on Start TCP-Server
  • Put the python library into a directory with your python source file
  • Paste this code into your source file:
from BubblePhysics import *
from time import sleep

# Connect to local host on port 26541 (the standard BubblePhysics port)
connect()

while True:
    move((0, -0.2))
    sleep(0.5)
    move((0, 0.2))
    sleep(0.5)

bubblephysics-education's People

Contributors

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