Coder Social home page Coder Social logo

pong-21's Introduction

Pong

This is a stylized version of Pong, built for the Godot Engine. You play in a circle. My primary goal was to make everything as simple and smooth as possible.

The smoothness comes from custom physics:

  • The control keys add acceleration to the paddles, rather than setting their velocities, so they glide instead of starting and stopping abruptly.
  • Hitting the ball with a moving paddle causes it to spin, curving its path.
  • Moving paddles elongate, making it slightly easier to hit the ball (and making the paddles, in my opinion, quite satisfying to move).
  • Hitting a paddle increases the ball's speed slightly, and hitting a wall decreases it. This is intended to scale the difficulty to match the players' abilities.

The art style is intentionally minimalist, with a few embellishments:

  • The paddles emit a faint glow outside the cirle. This makes them a bit easier to find, and does make them look a little more "polished."
  • The ball leaves a short translucent trail behind as it moves. This makes it easier to determine its path - particularly when it's spinning.
  • When the ball bounces, it emits a small splash. This serves as an indicator of what it bounced off of - a player's paddle if colored, or the wall if black.

Challenges

In no particular order...

  • Since I wrote my own rendering functions, none of my objects show up in the editor. This made positioning things a bit of a trial-and-error process.
  • Trigonometric functions are hard to think about when your origin is the top left of the screen. I often ended up just guessing until things worked.
  • Getting particle effects (the bounce splashes) to show up was hard - there are lots of simple errors that will prevent them from rendering.
  • Making decent-sounding sound effects was even harder! I'm still not satisfied with the current set.
  • The hardest part of playing the game is remembering that the controls aren't left and right, but clockwise and widdershins. This messed me up a lot while playtesting against myself. Hopefully it's easier when you only have a single paddle to keep track of...

Assets

Almost all of the graphics are generated programmatically. The text is generated from lines and segments of circles on startup (see *Text.gd). The various filled circles - including the ball and its blur trail - are produced by Godot's draw_circle() function. The paddles are also drawn as circle segments, and the paddle glow with colored quadrilaterals (set into additive blending mode, so the paddles turn magenta when overlapping).

The only pixels included with the game are the translucent circles used for the splash effect on bounces - the particle system required a texture. I made these in Photoshop.

I made the sound effects in Audacity. The musical notes are pure tones with a fade out applied. The "bad bounce" sound effect is also generated in Audacity, which refers to it as a Risset Drum.

pong-21's People

Contributors

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