Code Monkey home page Code Monkey logo

sonic-pong's Introduction

Currently supported platforms

Linux

What is this?

SonicPong currently is a final project for a university course and is still in its development phase. It may or may not be maintained by us further after February 2018.

Screenshot here. Video sadly without audio.

Yeah, but what exactly is the project?

SonicPong aims to become an audio game version of the classic game Pong. It will have a GUI and AUI for gaming. Currently we're working on supporting one audio and one visual player or two visual players. Somewhere in the future we're hoping to find the time and implement a version for two audio players. and some extra features.

Pong as audio game, how does that work?

Our current approach is the following:

  • The ball's position on the y-axis will be represented by its position in the stereo spectrum relative to the paddle of an audio player
  • The balls's position on the x-axis will be represented by the level of pitch in some way

What's the current state of development?

We're using the programming language Ruby, QML, Qt5 and SuperCollider for this. At the moment, the most promising approach is the latest commit on branch scruby (we're not actually using scruby!). It currently works on Linux only and uses Linux' audio server JACK.

Installation

Requirements

  • Linux
  • Ruby 2.4.0 (or later),
  • Ruby-QML,
  • Qt5,
  • SuperCollider.

Also, audio server JACK must be running.

Linux

There currently is no Gem-file (sorry, but we're not not quite there, yet), so clone the repository to your local drive and start\ ruby pathToYourClonedRepository/pong.rb\ from the command line or just cd into your cloned repository and start with\ ruby ./pong.rb.

Usage

Right paddle

  • Move up (up-arrow) and down (down-arrow) along the y-axis
  • If you miss the incoming ball, your opponent gains a point

Left Paddle

  • Move up (w) and down (s) along the y-axis
  • If you miss the incoming ball, your opponent gains a point

Ball

  • The ball is to be hit, so it won't leave the court on left or right side
  • If it does, your opponent will gain a point
  • The ball will bounce off the upper and lower sides of the court
  • In this case the ball will be served from the middle
  • Currently this will go on indefinitely

How is this relevant for teaching high school students?

Remember, this is project is meant to have educational aspects! So, single methods, especially class Ball and even more so the test classes, could be bold examples for analyzing in class. We see the project fit for teaching soft skills in software project management as well as, in terms of content, some introductory concepts of object-oriented programming. The project itself would be suitable as a final project at the end of a unit for gaining practical knowledge regarding previously discussed content of the curriculum.

sonic-pong's People

Contributors

friedz avatar occamsbeard avatar jasminmangei avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

occamsbeard

sonic-pong's Issues

Fall: Ball geht ins Aus -> Start ab Mitte

  • pong.rb
    -> bounce(x, y) prüft paddle collisions

Es soll implementiert werden, dass im Fall collision == nil der Ball zurück in die Mitte gesetzt wird und der nächste Aufschlag stattfindet.

#4 steht hiermit in Verbindung und kann bearbeitet werden, sobald das hier gelöst wurde.

Spiegelungen in bounce(): wie ist das genau?

  • pong.rb
    -> bounce(x, y)

Ich bin unsicher, ob ich die Kommentare zu den Spiegelungen richtig verstehe und da wirklich das passiert, was kommentiert wurde. Friedrich und Jasmin fragen.

Audio-Repräsentation der Ballposition

Es wird eine Pipe verwendet, um mit SuperCollider zu kommunizieren.

Zwei relevante Möglichkeiten für die Repräsentation:

  1. Ball wird relativ zur eigenen Schlägermitte repräsentiert.
    Dabei ist
    Ballposition auf Y-Achse stereo-links und
    Ballposition auf X-Achse Lautstärke (alternativ auch Tonhöhe o.Ä.).
  2. Ball wird "aus der Vogelperspektive (also wie visuell) repräsentiert.
    Dabei ist
    Ballposition auf Y-Achse Tonhöhe und
    Ballposition auf X-Achse stereo-links/-rechts.

In beiden Fällen gibt es reservierte Töne für

  • Kollision mit Schläger,
  • (aus der Vogelperspektive) oberem/unterem Spielfeldrand,
  • sowie Ball verlässt Spielfeld auf eigener oder gegnerischer Seite.

Anm.: Ich bin nicht ganz zufrieden mit der Verwendung des Stereospektrums, für den Fall, dass zwei Spieler gegeneinander spielen. Man müsste da dann zwei Stereosignale ausgeben, was leider gar nicht mal so praktisch ist. Man könnte sich da also eine alternative Repräsentation überlegen. Ist aber vielleicht für die Abgabe des Projekts nicht so wichtig und kann später mal gemacht werden.

Vektor erzeugen und Sound abspielen

  • Steigung,
  • Richtung,
  • Y-Achsenabschnitt

sollen im Vektor enthalten sein. Wenn sich der Vektor ändert, soll der Tonerzeugung aktiv der neue Vektor weitergegeben werden (bzw. ein entsprechendes anderes Ereignis).

ToDo

  • playSound(currentVector) soll currentVector an Scruby-Funktion weitergeben
  • und entsprechender Sound soll erzeugt werden
  • Variable currentVector existiert in Klasse Ball und enthält Steigung, Y-Achsenabschnitt, Richtung
  • Methode PlaySound existiert in Klasse Frame (weil nur frame mit QML kommunizieren kann).
  • Methode PlaySound wird in QML-Datei über frame getriggert

Verwandt mit Issue #5

Läuft momentan ausschließlich unter Linux

Auf dem Mac lässt sich der Start von sclangmomentan noch ein bisschen bitten… Wird vor der Projektabgabe aus Zeitgründen wohl nicht mehr gefixt.

Windows geht eh nicht, das ist aber ggf. ein Wontfix.

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.