<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>Tagged with #game - Processing 2.x and 3.x Forum</title>
      <link>https://forum.processing.org/two/discussions/tagged/feed.rss?Tag=%23game</link>
      <pubDate>Sun, 08 Aug 2021 14:51:02 +0000</pubDate>
         <description>Tagged with #game - Processing 2.x and 3.x Forum</description>
   <language>en-CA</language>
   <atom:link href="/two/discussions/tagged%23game/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>I created multiplayer online game with p5js</title>
      <link>https://forum.processing.org/two/discussion/28050/i-created-multiplayer-online-game-with-p5js</link>
      <pubDate>Sun, 10 Jun 2018 17:56:38 +0000</pubDate>
      <dc:creator>ognjenvucko</dc:creator>
      <guid isPermaLink="false">28050@/two/discussions</guid>
      <description><![CDATA[<p>Hi everyone,
I would like to share with community the game I created with p5js as a renderer.
It is a realtime multiplayer game, similar to AgarIO and other games in that ecosystem.</p>

<p>You can try it out on <a href="http://owom.io" target="_blank" rel="nofollow">http://owom.io</a></p>

<p>Feel free to ask any questions regarding tech, and any ideas on how the game might be improved are welcome!</p>
]]></description>
   </item>
   <item>
      <title>My game just hit 50 downloads! :)</title>
      <link>https://forum.processing.org/two/discussion/27702/my-game-just-hit-50-downloads</link>
      <pubDate>Fri, 06 Apr 2018 07:44:59 +0000</pubDate>
      <dc:creator>OliverC</dc:creator>
      <guid isPermaLink="false">27702@/two/discussions</guid>
      <description><![CDATA[<p>Hey all! I don't know if this is the right place to share this but I'm so excited and I just wanted to tell someone.</p>

<p>I got into programming a couple of months ago and just for fun I decided to practice my coding skills to make a simple little game - nothing too fancy. I uploaded it to the Google Play Store about a week ago. It's not a huge milestone to be proud of but I just hit 50 downloads today AHHHHHHH!!!</p>

<p>EDIT: <a rel="nofollow" href="https://play.google.com/store/apps/details?id=com.olivercheok.busjump">Here's the game if anyone's interested</a></p>
]]></description>
   </item>
   <item>
      <title>My game in Processing 2D RPG</title>
      <link>https://forum.processing.org/two/discussion/27475/my-game-in-processing-2d-rpg</link>
      <pubDate>Thu, 29 Mar 2018 11:39:12 +0000</pubDate>
      <dc:creator>GeorgeJava</dc:creator>
      <guid isPermaLink="false">27475@/two/discussions</guid>
      <description><![CDATA[<p>What do you think abou the CODE ? And game ? what to improve ? what to change ?
<a rel="nofollow" href="https://github.com/GeorgeSikora/Processing-GAME/tree/master">GITHUB HERE</a></p>
]]></description>
   </item>
   <item>
      <title>game - checking "hitted" / multiple shots.</title>
      <link>https://forum.processing.org/two/discussion/27649/game-checking-hitted-multiple-shots</link>
      <pubDate>Mon, 02 Apr 2018 17:20:14 +0000</pubDate>
      <dc:creator>DDv2FF</dc:creator>
      <guid isPermaLink="false">27649@/two/discussions</guid>
      <description><![CDATA[<p>Hi. Ive been creating a game. And im in this situation, where I have a target (the player), wich is getting shoted. It works, his points lifes goes down with every taken damage. But, I added a visual effect too, changing the color of the player to white, when the player is reached for a bullet. And It works too, but only with the last projectile type. For the player I created a class. There is 3 type of bullets, the first kind are stored in an array, and variables controling the position of a line for the last two types.<br />
The player "checker"</p>

<pre><code>    check(px, py){
            if(px &lt; this.x + this.r &amp;&amp; px &gt; this.x - this.r &amp;&amp; py &lt; this.y + this.r &amp;&amp; py &gt; this.y - this.r){
                this.vidas--;
                this.colorChange = true;
                return true;
            } else { this.colorChange = false; }
        }
    show(){
            push();
            if(this.colorChange){
                fill(255);
            } else {
                fill(250, 50, 100);
            }
            rect(this.x, this.y, this.r * 2, this.r * 2);
            pop();

        }
</code></pre>

<p>And then in the sketch</p>

<pre><code>for(var i = 0; i &lt; ataques.length; i++){
        if(karla.check(ataques[i].ptx, ataques[i].pty)){
            ataques.splice(i, 1);
            ataques.push(new Tela(karla.x));
        }
    }

if(karla.check(xa, yarañitas)|| xa &lt; -500){
        xa = 500;
      }

if(karla.check(xb, yarañitas) || xb &gt; 500){
        xb = -500;
      }
</code></pre>

<p>As I said, the points life thing works fine with all the bullet. But the changing color does not. Only with the last one. I tried using different function for each bullet type. No change..<br />
Hope you can help me with the given code, otherwise let me know, and I'll share the needed part. Thanks !!</p>
]]></description>
   </item>
   <item>
      <title>How to create a pile with this code ?</title>
      <link>https://forum.processing.org/two/discussion/27392/how-to-create-a-pile-with-this-code</link>
      <pubDate>Tue, 27 Mar 2018 07:28:30 +0000</pubDate>
      <dc:creator>hmerle</dc:creator>
      <guid isPermaLink="false">27392@/two/discussions</guid>
      <description><![CDATA[<p>Hello everyone, I am creating a card game based on a real game, and I want to create a pile for my game.</p>

<p>Here is the code that defines my game (yes I'm french) and the code for my pile :</p>

<p>Can someone help me finding a solution ? Thanks</p>

<p><img src="" alt="" /></p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/187/MJLN14OAXA2I.PNG" alt="Capture" title="Capture" />
<img src="https://forum.processing.org/two/uploads/imageupload/909/MS8XC3XZBN4J.PNG" alt="Capture2" title="Capture2" /></p>
]]></description>
   </item>
   <item>
      <title>Ptmx: How to draw overlayed maps (for vertical scrolling platform game)</title>
      <link>https://forum.processing.org/two/discussion/25892/ptmx-how-to-draw-overlayed-maps-for-vertical-scrolling-platform-game</link>
      <pubDate>Tue, 09 Jan 2018 22:57:27 +0000</pubDate>
      <dc:creator>Niels</dc:creator>
      <guid isPermaLink="false">25892@/two/discussions</guid>
      <description><![CDATA[<p>This is my first question posting to the forum, though I have been working with Processing for a couple of years. I am now in the process of helping my son to learn object-oriented programming and Processing is the ideal starting point for him.</p>

<p>We have been working with <a rel="nofollow" href="http://www.mapeditor.org/">"Tiled" Map Editor mapeditor.org</a> for a simple vertical scrolling platform game. Below is an example of a tile map that my son created which has two tile layers "Background" and "Foreground" (the objects are not being used in the sketch at present):</p>

<p><img src="https://farm5.staticflickr.com/4667/27824867269_47dd794261.jpg" alt="https://www.flickr.com/photos/njl-photolog/27824867269" /></p>

<p>Unfortunately, when we try to draw the "Background" layer with the "Foreground" layer overlayed on top we just get the "Foreground" layer. It appears that empty tiles and transparent areas of other tiles are being painted as black which paints over the "Background" layer tiles:</p>

<p><img src="https://farm5.staticflickr.com/4607/39572556302_dd777effe1.jpg" alt="https://www.flickr.com/photos/njl-photolog/39572556302" /></p>

<p>What we want to see happen is the "Foreground" layer overlay the "Background" and preserve the transparency. This way we can either move the "Background" together for the "Foreground" layer or at a different speed to create a parallax effect.</p>

<p>The code we are using is a modified version of the "MovingFree" example from the Ptmx library. I haven't posted the additional files (TMX, TSX and PNGs) needed to run this sketch -- it would make a very long post, but I will email a zip file of the whole thing if necessary to anyone.</p>

<p>The sketch code we are using is here:</p>

<pre><code>// Example of using "Tiled" generated maps
// Modified from the PTMX library's example "MovingFree"

import ptmx.*;

final int tileSize = 70;

Ptmx map;
PImage smiley;
int xMapOffset = 7 * tileSize;
int xMapPosition, yMapPosition;
int xMovement = tileSize;

boolean flagLeft, flagRight, flagUp, flagDown; // Arrow direction keys that are being pressed

// Layer IDs are hard-wired for now.
// Note: It would be great to have an accessor method, like getName(i), to retrieve a layer's text name ;-)
int idForegroundLayer = 1;
int idBackgroundLayer = 0;

void setup() {
  // Long way round to set window size using variables. ;-)
  int dw = 15 * tileSize;
  int dh = 10 * tileSize;
  size(600, 400);
  frameRate(10);
  surface.setResizable(true);
  surface.setSize(dw, dh);

  smiley = loadImage("assets/smiley.png");

  map = new Ptmx(this, "Level_Two.tmx");
  map.setDrawMode(CORNERS);
  map.setPositionMode("CANVAS"); // Default Position Mode

  // Starting position for a vertical scrolling platform
  xMapPosition = 0;
  yMapPosition = 0;
  imageMode(CORNERS); // x,y refer to the upper-left corner
}

void draw() {
  int xSprite = width / 2;
  int ySprite = 8 * tileSize;
  String textDir = "";
  int tileNum;

  // In "Level_Two.tmx" the Map Properties-&gt;Background Color is set to 120,219,231 "Shade of cyan",
  // but empty tiles are painted as black squares so no cyan background appears
  background(map.getBackgroundColor());

  // Tiles in the foreground layer paint (with black) over tiles in the background!
  map.draw(idBackgroundLayer, xMapPosition, yMapPosition);
  map.draw(idForegroundLayer, xMapPosition, yMapPosition);

  image(smiley, xSprite, ySprite); // Draw player's sprite image

  int prevX = xMapPosition;
  int prevY = yMapPosition;

  if (flagLeft)  { xMapPosition -= xMovement; textDir += "&lt;"; }
  if (flagRight) { xMapPosition += xMovement; textDir += "&gt;"; }

  // Retrieve tile number that we are over in the foreground layer
  tileNum = map.getTileIndex(idForegroundLayer, int((xMapPosition + xSprite) / tileSize), int((yMapPosition + ySprite) / tileSize));

  // Show on-screen diagnostic information
  textSize(18);
  fill(200);
  text("Move (almost) free. Map x,y = " + xMapPosition + "," + yMapPosition +
      " Sprite x,y = " + xSprite + "," + ySprite + " tile = " + tileNum + " dir: " + textDir, 10, 50);
}


void keyPressed(){
  if (keyCode == LEFT) flagLeft = true;
  if (keyCode == RIGHT) flagRight = true;
}

void keyReleased(){
  if (keyCode == LEFT) flagLeft = false;
  if (keyCode == RIGHT) flagRight = false;
}
</code></pre>

<p>FYI: I have contacted the author of the Ptmx library (linux-man) prior to posting this question, but I wanted to post our question and examples on the forum so other to could see it too.</p>
]]></description>
   </item>
   <item>
      <title>Strange overlapping of sprites with Sprite library, what's wrong?</title>
      <link>https://forum.processing.org/two/discussion/25637/strange-overlapping-of-sprites-with-sprite-library-what-s-wrong</link>
      <pubDate>Tue, 19 Dec 2017 07:00:31 +0000</pubDate>
      <dc:creator>Paraf0x</dc:creator>
      <guid isPermaLink="false">25637@/two/discussions</guid>
      <description><![CDATA[<p>Hello and good day.<br />
I work with the Sprite library by Peter Lager.<br />
My current project is a 2D platformer and I got a rly strange problem but I cant't find the exact source.<br />
I restricted the problem of the overlapping Sprites to the WorldManager class in the <code>void registerWorld(int index)</code> function.<br />
I use  <code>S4P.updateSprites(sw.getElapsedTime()); S4P.drawSprites();</code><br />
to display the sprites.<br />
It seems that all 3 worlds get registered by S4P at the same time.<br />
The content of the 3 worldfiles I got here is like that,</p>

<pre><code>OOOOOOOOOO

O________O

OZZZZZZZZO
</code></pre>

<p><img src="https://i.imgur.com/Y18MQdf.png" alt="" /></p>

<pre><code>//GameProject_Disconnect
import sprites.*;
import sprites.maths.*;
import sprites.utils.*;
import java.util.*;
import java.lang.*;

StopWatch sw;
WorldManager wm;

void setup() {
  size(500, 500);
  sw = new StopWatch();
  wm = new WorldManager(this);
}


void draw() {
  background(0);
  S4P.updateSprites(sw.getElapsedTime());
  S4P.drawSprites();
}

//WorldManager 

class WorldManager {
  FileManager fm;
  WorldTranslater wt;
  ArrayList&lt;World&gt; worlds;

  WorldManager(PApplet _pa) {
    fm = new FileManager();
    wt = new WorldTranslater(_pa);
    initWorlds();
    registerWorld(0);
  }


  void registerWorld(int index) {
    Sprite[][] tempW = worlds.get(index).getWorldMap();
    for (int i=0; i &lt; 5; i++) {
      for (int j=0; j &lt; 10; j++) {
        S4P.registerSprite(tempW[i][j]);
      }
    }
  }


  private void initWorlds() {
    worlds = new ArrayList&lt;World&gt;();
    for (int i=0; i &lt; fm.getNumberOfWorlds(); i++) {
      World tempWorld = new World(
        fm.getFileContent(i), 
        wt.translateWorld(fm.getFileContent(i)), 
        fm.getTrimmedFilename(i), 
        fm.getWorldPath(i));
      worlds.add(new World());
      worlds.set(i, tempWorld);
    }
    println("Worlds successful loaded!");
  }
}

//FileManager

class FileManager {
  private String worldPath; // Path of the world files. 
  private String[] rawFilenames; // Filenames with prefix and suffix.
  private String[] trimmedFilenames; // Filenames without prefix and suffix.
  private ArrayList&lt;String[]&gt; fileContent; // Save the file content here. 
  private int numberOfFiles; // Number of worlds found.

  FileManager() {
    worldPath = new String(sketchPath() + "/Worlds/");
    readFileDirectory();
    numberOfFiles = rawFilenames.length;
    trimFilenames();
    fileContent  = new ArrayList&lt;String[]&gt;();
    initFileContent();
  }
  // Give me the content of one file chosen by index.
  String[] getFileContent(int index) {
    return fileContent.get(index);
  }

  int getNumberOfWorlds() {
    return numberOfFiles;
  }

  String getWorldPath(int index) {
    return new String(worldPath + rawFilenames[index]);
  }

  String getRawFilename(int index) {
    return rawFilenames[index];
  }

  String getTrimmedFilename(int index) {
    return trimmedFilenames[index];
  }

  private void initFileContent() {
    for (int i=0; i &lt; numberOfFiles; i++) {
      fileContent.add(new String[0]);
      fileContent.set(i, parseFile(rawFilenames[i]));
    }
  }

  // Get all filenames from the world directory.
  private void readFileDirectory() {
    rawFilenames = getFilenames(worldPath);
  }
  // Cut the prefix and suffix off.
  private void trimFilenames() {
    trimmedFilenames = cutFilenames(getFilenames(worldPath));
  }

  // Reade the content of the file.
  private String[] parseFile(String filename) {
    BufferedReader reader = createReader(worldPath + filename);
    String line = null;
    String[] tempWorld = new String[5];
    int counter = 0;
    try {
      while ((line = reader.readLine()) != null) {
        tempWorld[counter] = line;
        counter++;
      }
      reader.close();
    } 
    catch (IOException e) {
      e.printStackTrace();
    }
    return tempWorld;
  }

  // Return all the raw filenames in a directory as an array of Strings.
  private String[] getFilenames(String dir) { 
    File file = new File(dir);
    if (file.isDirectory()) { 
      String[] names = file.list();
      return names;
    } else {
      // If it's not a directory.
      println("ERROR: There is no worlds directory!");
      return null;
    }
  }

  // Delete the prefix and the suffix of the filename.
  private String[] cutFilenames(String[] filenames) {
    String[] names = filenames;
    for (int i=0; i &lt; names.length; i++) { 
      names[i] = names[i].substring(2, names[i].length()-4); // -4 for the ".txt" suffix.
    }
    return names;
  }
}

//WorldTranslater

class WorldTranslater {
  PApplet pa;
  // Agreements for the height and width of a world.
  final int mapWidth = 10;
  final int mapHeight = 5;

  private String[] crypticWorld;
  private Sprite[][] translatedWorld;

  final String wall = "Sprites/Wall.png";
  final String background = "Sprites/Background.png";
  final String ground = "Sprites/Ground.png";
  final String platform = "Sprites/Platform2.png";
  final String nothing = "Sprites/Nothing.png";

  final int viewDistance = 1; // The higher the number, the closer is the picture in the foreground.

  WorldTranslater(PApplet _pa) {
    pa = _pa;
    crypticWorld    = null;
    translatedWorld = new Sprite[mapHeight][mapWidth];
  }
  // Give me the fancy sprite array from this cryptical String array plz.
  public Sprite[][] translateWorld(String[] cw) {
    crypticWorld = cw;
    translateCWorld();
    return translatedWorld;
  }

  // Translate the crypticWorld to a world with fancy sprites.
  private void translateCWorld() {
    Sprite sp; 
    for (int i=0; i &lt; mapHeight; i++) {
      for (int j=0; j &lt; mapWidth; j++) {
        sp = distinguishSprite(crypticWorld[i].charAt(j));
        sp.setPos(new Vector2D(sp.getWidth()*j, sp.getHeight()*i));
        translatedWorld[i][j] = sp;
      }
    }
  }

  // Check which token is which sprite.
  private Sprite distinguishSprite(char c) {
    if (c == 'O') {
      return new Sprite(pa, wall, viewDistance);
    } else if (c == 'X') {
      return new Sprite(pa, background, viewDistance);
    } else if (c == 'Z') {
      return new Sprite(pa, ground, viewDistance);
    } else if (c == '_') {
      return new Sprite(pa, platform, viewDistance);
    } else if (c == ' ') {
      return new Sprite(pa, nothing, viewDistance);
    }
    println("ERROR: Invalid token");
    return null;
  }
};

//WorldObjekt

class World {
  private String[] rawWorldMap;
  private Sprite[][] worldMap;
  private String name;
  private String path;

  World() {
    rawWorldMap = null;
    worldMap = null;
    name = null;
    path = null;
  }

  World(String[] _rawWorldMap, Sprite[][] _worldMap, String _name, String _path) {
    rawWorldMap = _rawWorldMap;
    worldMap = _worldMap;
    name = _name;
    path = _path;
  }

  public Sprite[][] getWorldMap() {
    return worldMap;
  }

  String[] getRawWorldMap() {
    return rawWorldMap;
  }

  String getName() {
    return name;
  }

  String getPath() {
    return path;
  }
};
</code></pre>
]]></description>
   </item>
   <item>
      <title>browsers who see my website for the 1st time show an older version</title>
      <link>https://forum.processing.org/two/discussion/25476/browsers-who-see-my-website-for-the-1st-time-show-an-older-version</link>
      <pubDate>Sat, 09 Dec 2017 18:17:34 +0000</pubDate>
      <dc:creator>ravel44</dc:creator>
      <guid isPermaLink="false">25476@/two/discussions</guid>
      <description><![CDATA[<p>Hi !
I reuploaded all my files to my host 12h ago. When sending my website to friends who never went to my url before, they see my old website...
Even on my Chrome browser, it keeps showing the older version unless I hit inspect and then reload by selecting "empty cache and hard load". And even if I type again my url after doing the inspect/emptycache/hardload method, it's showing the old version again.
What am I missing ?</p>
]]></description>
   </item>
   <item>
      <title>Mooze - Simple android game made with processing</title>
      <link>https://forum.processing.org/two/discussion/25636/mooze-simple-android-game-made-with-processing</link>
      <pubDate>Tue, 19 Dec 2017 02:47:14 +0000</pubDate>
      <dc:creator>huynhhoang260996</dc:creator>
      <guid isPermaLink="false">25636@/two/discussions</guid>
      <description><![CDATA[<p>Hi everyone!</p>

<p>I'd like to share with you a game I created with processing as an assignment for an online processing course. It's called Mooze, and is now available in the google play store for free:</p>

<p><a href="https://play.google.com/store/apps/details?id=processing.test.mooze" target="_blank" rel="nofollow">https://play.google.com/store/apps/details?id=processing.test.mooze</a></p>

<p>Here are a few screenshots from the game:</p>

<p>1 2 3 4 5 6</p>

<p>And a description (from google play):</p>

<p>Try to hit a ball using springs in an infinite world where gravity gets stronger over time. This insanely addictive arcade game will have you and your friends fighting for the best score! How high can you get?</p>

<p>Features: - Beautiful, minimalistic graphics - Infinite gameplay - Increasing difficulty over time - Highscores are saved - Simple sounds (can be turned off)</p>

<p>How to play: - Drag down and release the white springs (lines) (protip: drag them down as far as you can) - The lower the springs are dragged the harder they will hit the ball - Tilt the device to slightly move the ball left and right (this is subtle but it helps wonders) - To pause, touch the score counter at the top left of the screen or hit the back button - In the pause menu you can also turn the sound on and off</p>
]]></description>
   </item>
   <item>
      <title>My Little LAN Game</title>
      <link>https://forum.processing.org/two/discussion/25144/my-little-lan-game</link>
      <pubDate>Wed, 22 Nov 2017 13:44:00 +0000</pubDate>
      <dc:creator>NewStudent</dc:creator>
      <guid isPermaLink="false">25144@/two/discussions</guid>
      <description><![CDATA[<p>Hey guys recently i created this little game but i am not able to test it completely because i do not have a second computer on the same network i was hoping you guys could test it here is the code:</p>

<p>RPG_Game.pde:</p>

<pre><code>import oscP5.*;
import netP5.*;
import processing.net.*;
OscP5 oscP5;
NetAddress myRemoteLocation;
Player player;
Bullet bullet;
Bullet playerBullet;
Player player2;
String playerIP = "";
String myIP;
boolean setup = true;
boolean load = false;
float loadV;
boolean connected = false;
float previous;
float stepPrevious;
boolean error = false;
int x;
int y;
boolean changeStep = false;
int step = 1;
int stepValue = 5;
float previousWay = UP;
boolean walking = false;
int range = 800;
boolean fireable = false;

void setup()
{
  bullet = new Bullet(color(255, 0, 0));
  playerBullet = new Bullet(color(0, 255, 0));
  background(255, 102, 0);
  myIP = Server.ip();
  fullScreen();
  oscP5 = new OscP5(this, 23492);
  textSize(48);
  textAlign(CENTER);
  player = new Player();
  player2 = new Player();
  x = width / 2;
  y = height / 2;
}

void draw()
{
  checkTime();
  background(255, 102, 0);
  set_up();
  load();
  player.show();
  player2.show();
  bullet.show();
  playerBullet.show();
  checkBulletPlayer();
  checkBulletOtherPlayer();
  showScore();
  if (walking) moveCharacter();
  if (bullet.show) bullet.move();
  if (playerBullet.show) playerBullet.move();
  if (!bullet.show) bullet.setDir(previousWay);
  if (!playerBullet.show) playerBullet.setDir(previousWay);
}

void keyPressed()
{
  keySetup();
  if (keyCode == UP || keyCode == DOWN || keyCode == LEFT || keyCode == RIGHT) walking = true;
  if (key == 'f' &amp;&amp; bullet.show == false &amp;&amp; !setup &amp;&amp; !load)
  {
    bullet.fire();
    OscMessage myMessage = new OscMessage("playerBullet");
    myMessage.add(bullet.bx);
    myMessage.add(bullet.by);
    myMessage.add(bullet.bdir);
    oscP5.send(myMessage, myRemoteLocation);
  }
  if (key == 'q' &amp;&amp; !setup &amp;&amp; !load) range = 300;
  if (key == 'w' &amp;&amp; !setup &amp;&amp; !load) range = 500;
  if (key == 'e' &amp;&amp; !setup &amp;&amp; !load) range = 800;
}

void keyReleased()
{
  if (keyCode == UP || keyCode == DOWN || keyCode == LEFT || keyCode == RIGHT) walking = false;
}

public void oscEvent(OscMessage theOscMessage)
{
  if (theOscMessage.checkAddrPattern("playerBullet"))
  {
    playerBullet.bx = theOscMessage.get(0).floatValue();
    playerBullet.by = theOscMessage.get(1).floatValue();
    playerBullet.setDir(theOscMessage.get(2).floatValue());
    playerBullet.fire();
  }
  if (theOscMessage.checkAddrPattern("PlayerCoor"))
  {
    player2.move(theOscMessage.get(0).intValue(), theOscMessage.get(1).intValue(), theOscMessage.get(2).intValue(), theOscMessage.get(3).intValue());
  }
  if (theOscMessage.checkAddrPattern("ConnectReq"))
  {
    myRemoteLocation = new NetAddress(theOscMessage.get(0).stringValue(), 23492);
    OscMessage myMessage = new OscMessage("Connect");
    myMessage.add("yes");
    oscP5.send(myMessage, myRemoteLocation);
  }
  if (theOscMessage.checkAddrPattern("Connect")) connected = true;
}
</code></pre>

<p>Bullet.pde:</p>

<pre><code>class Bullet
{
  float bx;
  float by;
  float bdir;
  boolean show = false;
  float previousX;
  float previousY;
  color clr;

  Bullet(color a)
  {
    bdir = UP;
    clr = a;
  }

  void move()
  {
    if (bdir == UP) by -= 55;
    if (bdir == LEFT) bx -= 55;
    if (bdir == DOWN) by += 55;
    if (bdir == RIGHT) bx += 55;
    if(dist(previousX, previousY, bx, by) &gt; range) show = false;
  }

  void show()
  {
    if (show)
    {
      noStroke();
      fill(clr);
      ellipse(bx + 24, by + 24, 10, 10);
      stroke(0);
      fill(255);
    }
    if(!show) bx = by = -1000;
  }

  void fire()
  {
    bx = player.x;
    by = player.y;
    previousX = bx;
    previousY = by;
    show = true;
  }

  void setDir(float _dir)
  {
    bdir = _dir;
  }
}
</code></pre>

<p>Draw.pde:</p>

<pre><code>void set_up()
{
  if (setup)
  {
    text("Enter Other Players IP:", width / 2, height / 3);
    text("Your IP: " + myIP, width / 2, height / 7);
    fill(0, 188, 255);
    text(playerIP, width / 2, height / 2 + 15);
    fill(255);
    if (error) text("Failed to Connect or Other Machine did not Respond", width / 2, height / 2 + 200);
  }
}

void load()
{
  if (load)
  {
    if (connected) loadV += 5;
    fill(255);
    text("Connecting to: " + playerIP, width / 2, height /  7);
    rectMode(CENTER);
    rect(width / 2, height / 2, 500, 100);
    fill(255, 0, 0);
    rectMode(CORNER);
    rect(width / 2 - 250, height / 2 - 50, loadV, 100);
    if (millis() - previous &gt; 5000 &amp;&amp; loadV &lt; 500)
    {
      loadV = 0;
      setup = true;
      load = false;
      connected = false;
      error = true;
    }
    if (loadV == 500) load = false;
  }
}

void keySetup()
{
  if (setup &amp;&amp; keyCode != CONTROL &amp;&amp; keyCode != SHIFT &amp;&amp; keyCode != 524)
  {
    if (keyCode == BACKSPACE)
    {
      if (playerIP.length() &gt; 0) playerIP = playerIP.substring(0, playerIP.length() - 1);
    } else
    {
      if (keyCode == ENTER)
      {
        error = false;
        if (!playerIP.equals(""))
        {
          myRemoteLocation = new NetAddress(playerIP, 23492);
          setup = false;
          load = true;
          OscMessage myMessage = new OscMessage("ConnectReq");
          myMessage.add(myIP);
          oscP5.send(myMessage, myRemoteLocation);
          previous = millis();
        }
      } else
      {
        playerIP += key;
      }
    }
  }
  if (keyCode == TAB)
  {
    loadV = 0;
    setup = true;
    load = false;
    connected = false;
  }
}

void moveCharacter()
{
  if (!setup &amp;&amp; !load)
  {
    if (keyCode == UP)
    {
      previousWay = UP;
      if (y &gt; 0) y -= stepValue;
      if (changeStep)
      {
        if (step == 1) step = 2;
        else if (step == 2) step = 1;
        changeStep = false;
      }
      player.move(x, y, UP, step);
      OscMessage myMessage = new OscMessage("PlayerCoor");
      myMessage.add(x);
      myMessage.add(y);
      myMessage.add(UP);
      myMessage.add(step);
      oscP5.send(myMessage, myRemoteLocation);
    }
    if (keyCode == DOWN)
    {
      previousWay = DOWN;
      if (y + 65 &lt; height) y += stepValue;
      if (changeStep)
      {
        if (step == 1) step = 2;
        else if (step == 2) step = 1;
        changeStep = false;
      }
      player.move(x, y, DOWN, step);
      OscMessage myMessage = new OscMessage("PlayerCoor");
      myMessage.add(x);
      myMessage.add(y);
      myMessage.add(DOWN);
      myMessage.add(step);
      oscP5.send(myMessage, myRemoteLocation);
    }
    if (keyCode == LEFT)
    {
      previousWay = LEFT;
      if (x &gt; 0) x -= stepValue;
      if (changeStep)
      {
        if (step == 1) step = 2;
        else if (step == 2) step = 1;
        changeStep = false;
      }
      player.move(x, y, LEFT, step);
      OscMessage myMessage = new OscMessage("PlayerCoor");
      myMessage.add(x);
      myMessage.add(y);
      myMessage.add(LEFT);
      myMessage.add(step);
      oscP5.send(myMessage, myRemoteLocation);
    }
    if (keyCode == RIGHT)
    {
      previousWay = RIGHT;
      if (x + 65 &lt; width) x += stepValue;
      if (changeStep)
      {
        if (step == 1) step = 2;
        else if (step == 2) step = 1;
        changeStep = false;
      }
      player.move(x, y, RIGHT, step);
      OscMessage myMessage = new OscMessage("PlayerCoor");
      myMessage.add(x);
      myMessage.add(y);
      myMessage.add(RIGHT);
      myMessage.add(step);
      oscP5.send(myMessage, myRemoteLocation);
    }
  }
}

void checkTime()
{
  if (millis() - stepPrevious &gt;= 200)
  {
    stepPrevious = millis();
    changeStep = true;
  }
}

void checkBulletPlayer()
{
  if (playerBullet.bx &gt; x - 15 &amp;&amp; playerBullet.bx &lt; x + 32 &amp;&amp; playerBullet.by &gt; y - 15 &amp;&amp; playerBullet.by &lt; y + 32)
  {
    player.health -= 20;
    if (player.health &lt;= 0)
    {
      player2.score++;
      player.health = 100;
      player.x = width / 2;
      player.y = height / 2;
      x = width / 2;
      y = height / 2;
    }
  }
}

void checkBulletOtherPlayer()
{
  if (bullet.bx &gt; player2.x - 15 &amp;&amp; bullet.bx &lt; player2.x + 32 &amp;&amp; bullet.by &gt; player2.y - 15 &amp;&amp; bullet.by &lt; player2.y + 32)
  {
    player2.health -= 20;
    if (player2.health &lt;= 0)
    {
      player.score++;
      player2.health = 100;
      player2.x = width / 2;
      player2.y = height / 2;
    }
  }
}

void showScore()
{
  if (!setup &amp;&amp; !load)
  {
    fill(255);
    text((int) player.score, width / 10, height / 10);
    text((int) player2.score, width - 150, height / 10);
  }
}
</code></pre>

<p>Player.pde:</p>

<pre><code>class Player
{
  PImage player = loadImage("character.png");
  PImage sprite = player.get(0, 97, 32, 32);;
  float x;
  float y;
  float dir;
  int foot = 1;
  float health = 100;
  float score = 0;

  Player()
  {
    x = width / 2;
    y = height / 2;
    dir = UP;
  }

  void move(float _x, float _y, float _dir, int _foot)
  {
    x = _x;
    y = _y;
    dir = _dir;
    foot = _foot;
    if(dir == UP &amp;&amp; foot == 1) sprite = player.get(0, 97, 32, 32);
    if(dir == UP  &amp;&amp; foot == 2) sprite = player.get(66, 97, 32, 32);
    if(dir == LEFT &amp;&amp; foot == 1) sprite = player.get(0, 32, 32, 32);
    if(dir == LEFT &amp;&amp; foot == 2) sprite = player.get(66, 32, 32, 32);
    if(dir == DOWN &amp;&amp; foot == 1) sprite = player.get(0, 128, 32, 32);
    if(dir == DOWN &amp;&amp; foot == 2) sprite = player.get(66, 128, 32, 32);
    if(dir == RIGHT &amp;&amp; foot == 1) sprite = player.get(0, 191, 32, 32);
    if(dir == RIGHT &amp;&amp; foot == 2) sprite = player.get(66, 191, 32, 32);
  }

  void show()
  {
    if (!setup &amp;&amp; !load)
    {
      sprite.resize(48, 48);
      image(sprite, x, y);
      fill(map(health, 20, 100, 255, 0), 0, 0);
      ellipse(x, y, 10, 10);
      fill(255);
    }
  }
}
</code></pre>

<p>I am open to any suggestions and opinions.
Thanks</p>

<p>and here is the character.png file:</p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/508/QEL8KBAM7B1C.png" alt="character" title="character" /></p>
]]></description>
   </item>
   <item>
      <title>Beta Release of my new game - Alchemy</title>
      <link>https://forum.processing.org/two/discussion/24633/beta-release-of-my-new-game-alchemy</link>
      <pubDate>Wed, 18 Oct 2017 21:50:39 +0000</pubDate>
      <dc:creator>Vanthex</dc:creator>
      <guid isPermaLink="false">24633@/two/discussions</guid>
      <description><![CDATA[<p><strong>What is this?</strong></p>

<p>This game is called Alchemy. It is similar to games like Alchemy Classic and Doodle God. However, Alchemy is full customizable and users can easily add their own content to the game and even alter the textures! The game is an executable and can run on Windows PC (or Mac and Linux if you use Wine).</p>

<p><a rel="nofollow" href="http://thealchemygame.weebly.com/gallery.html"><strong>In-game Screenshots</strong></a></p>

<p><img src="https://i.imgur.com/CmvvOrp.png" alt="" /></p>

<p><img src="https://i.imgur.com/SWyfgLs.png" alt="" /></p>

<p><img src="https://i.imgur.com/xoHCtyM.png" alt="" /></p>

<p><strong>How to play</strong></p>

<p>Simply download the zip file and extract it, then open Alchemy.exe and you're good to go! Once the game has launched (it takes around 15 seconds) click "New game" to start. A brief tutorial is included to introduce players to the gameplay. If you're stuck, you can use the hint button that will provide you an element that you can create. Don't forget to save before you exit! <a rel="nofollow" href="http://thealchemygame.weebly.com/manual.html">Click here for a complete manual.</a>
In the main menu's bottom left corner there is a settings button which includes different settings. You can learn more about them <a rel="nofollow" href="http://thealchemygame.weebly.com/about.html">here</a>.</p>

<p><strong>How to customize</strong></p>

<p>You can customize the game with packs. You can learn how to make your own pack <a rel="nofollow" href="http://thealchemygame.weebly.com/manual.html">here</a>.</p>

<p><a rel="nofollow" href="http://thealchemygame.weebly.com/download.html"><strong>Download</strong></a></p>

<p>Please feel free to report any bugs or provide feedback!</p>

<p>I made the whole game in Java using Processing library and other small libraries.</p>
]]></description>
   </item>
   <item>
      <title>Porting code to Arduboy (from Processing to C++)</title>
      <link>https://forum.processing.org/two/discussion/24242/porting-code-to-arduboy-from-processing-to-c</link>
      <pubDate>Sun, 24 Sep 2017 19:21:15 +0000</pubDate>
      <dc:creator>luxregina</dc:creator>
      <guid isPermaLink="false">24242@/two/discussions</guid>
      <description><![CDATA[<p>Hello everyone!</p>

<p>I'm building a prototype for an <a href="https://arduboy.com/" target="_blank" rel="nofollow">https://arduboy.com/</a> game
A video of what's playable so far can be seen here: <span class="VideoWrap"><span class="Video YouTube" id="youtube-HZpErpFeYKk"><span class="VideoPreview"><a href="http://youtube.com/watch?v=HZpErpFeYKk"><img src="http://img.youtube.com/vi/HZpErpFeYKk/0.jpg" width="640" height="385" border="0" /></a></span><span class="VideoPlayer"></span></span></span></p>

<p>I'm developing the prototype using Processing. I was wondering if a good soul would help me translate my code to C++ which is what's needed to compile for Arduboy. It will be distributed for free, and open sourced. I'll provide the fully functional Processing code. No money involved, but the opportunity to get coding credit on hopefully a fun little game on a fun little device.</p>

<p>Some images of the game: <img src="http://www.garage-collective.com/arduboy/dark&amp;under.gif" alt="" /></p>
]]></description>
   </item>
   <item>
      <title>Game</title>
      <link>https://forum.processing.org/two/discussion/22990/game</link>
      <pubDate>Thu, 08 Jun 2017 17:13:34 +0000</pubDate>
      <dc:creator>rockie</dc:creator>
      <guid isPermaLink="false">22990@/two/discussions</guid>
      <description><![CDATA[<p>Hey guys, what can I do to make this game more interesting? And how do I do it? Any ideas? Thanks!</p>

<pre><code>float posx = width;
float posy = height;
float velx = 5;
float vely = 2;
float baseh = 10;
float basew = 90;
int pont = 0;
int nivel = 1;

void setup() {
  size(800, 600);
  background(206, 234, 211);
}

void draw() {
  background(167, 167, 167);
  noStroke();
  posx += velx;
  posy += vely;
  fill(206, 234, 211);
  ellipse(posx, posy, 30, 30);
  fill(62, 62, 62);
  rect(mouseX, height-baseh, basew, baseh);
  textSize(15);
 textAlign(CENTER);
  fill(255);
  //text("jogos: " + score, width/2, height/4);
  fill(255);
  // text("NÍVEL " + nivel + "/3", width/2, height/2);


  if (posx&gt;=width) {
    velx = -velx;

  } else if (posx&lt;=0) {
    velx = +-velx;


  } else if (posy&gt;=(height)-baseh &amp;&amp; posx&gt;=mouseX &amp;&amp;
    posx&lt;mouseX + basew) {
    vely = -vely;

  } 

  else if (posy&gt;=height) {
    posx = width/2;
    posy = height/2;
    pont += 5;
    velx = 5;
    vely = 2;
    nivel = 1;

  }

  else if (posy&lt;=0) {
    vely = +-vely * 2;
  }

  if (vely&gt;=8) {

    nivel = 2;
  } 

  else if (vely&gt;=10) {
    nivel = 3;
  }
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Need Help with the Specifics of Timers.</title>
      <link>https://forum.processing.org/two/discussion/23030/need-help-with-the-specifics-of-timers</link>
      <pubDate>Sun, 11 Jun 2017 19:36:46 +0000</pubDate>
      <dc:creator>AlCoda</dc:creator>
      <guid isPermaLink="false">23030@/two/discussions</guid>
      <description><![CDATA[<p>I'm trying to make a timer for a game to track events and where exactly the player is. However, I am having trouble figuring out how to stop the timer when the player pressed ESC to pause and start it again when they press ESC again. I'm also confused on how to reset a timer back to zero. Any help is appreciated, thanks in advance for anyone's time.</p>
]]></description>
   </item>
   <item>
      <title>hey, could anyone look my code</title>
      <link>https://forum.processing.org/two/discussion/22932/hey-could-anyone-look-my-code</link>
      <pubDate>Mon, 05 Jun 2017 08:39:01 +0000</pubDate>
      <dc:creator>gbel</dc:creator>
      <guid isPermaLink="false">22932@/two/discussions</guid>
      <description><![CDATA[<p>hey, could anyone look my code and tell me why does it give a nullpointerexception in the decor window thanks
here is the code with all the docs, thanks!
<a href="https://drive.google.com/open?id=0B2wuQAektZMtM05sckJUWmFTazQ" target="_blank" rel="nofollow">https://drive.google.com/open?id=0B2wuQAektZMtM05sckJUWmFTazQ</a></p>
]]></description>
   </item>
   <item>
      <title>Display decor using tables</title>
      <link>https://forum.processing.org/two/discussion/10963/display-decor-using-tables</link>
      <pubDate>Sat, 23 May 2015 19:18:43 +0000</pubDate>
      <dc:creator>Spacetcha</dc:creator>
      <guid isPermaLink="false">10963@/two/discussions</guid>
      <description><![CDATA[<p>Hello,</p>

<p>I inform you I'm not a programmer and don't know the word and the best practices.</p>

<p>My project is to create a donkey kong video game using Processing, the old version of DK with Mario and ladders, etc..</p>

<p>In order to display the decor and then use those data to interact with Mario, I would like to add those data in a table.</p>

<p>I don't know if I'm clear but I need help for this.
Thank you;</p>

<hr />

<pre><code>int
ecran_w = 1200, 
ecran_h = 675, 
mario_pos_x = 50, 
mario_pos_y = 570;

boolean
engagementSaut = false, 
keyup = false, 
keyright = false, 
keyleft = false, 
keydown = false, 
keyspace = false;

ArrayList 
DecorList = new ArrayList();

PImage
photoVictoire, 
mario_r, 
mario_l, 
DonkeyKong, 
Peach;

Decor decor = new Decor(0, 600, 1200, 25, 255, 165, 0);


void setup() {
  frameRate(150);
  size(ecran_w, ecran_h);
  background(0);

  photoVictoire = loadImage("DK 64 Victory.png");
  mario_r = loadImage("Mario_R.png");
  mario_l = loadImage("Mario_L.png");
  DonkeyKong = loadImage("Donkey Kong.png");
  Peach = loadImage("Peach.png");
}

void draw() {
  background(0);

  image(DonkeyKong, 50, 144);
  image(Peach, 500, 55);

  decor.init();
  decor.display();
}


class Decor {
  int x, y, largeur, hauteur, couleurRed, couleurGreen, couleurBlue;

  Decor(int xpos, int ypos, int l, int h, int cR, int cG, int cB) {
    x = xpos;
    y = ypos;
    largeur = l;
    hauteur = h;
    couleurRed = cR;
    couleurGreen = cG;
    couleurBlue = cB;
  }

  void display() {
    for (int i = 0; i &lt; DecorList.size (); i++) {
      Decor xpos = (Decor) DecorList.get(i); 
      Decor ypos = (Decor) DecorList.get(i);
      Decor l = (Decor) DecorList.get(i);
      Decor h = (Decor) DecorList.get(i);
      Decor cR = (Decor) DecorList.get(i);
      Decor cG = (Decor) DecorList.get(i);
      Decor cB = (Decor) DecorList.get(i);

      fill(couleurRed, couleurGreen, couleurBlue);
      rect(x, y, largeur, hauteur);
    }
  }

  void init() {  
    if (DecorList.size()&lt;8) {
      DecorList.add (new Decor(0, 600, 1200, 25, 255, 165, 0));
      DecorList.add (new Decor(0, 500, 1200, 25, 255, 165, 0));
      DecorList.add (new Decor(0, 400, 200, 25, 255, 165, 0));
      DecorList.add (new Decor(300, 400, 600, 25, 255, 165, 0));
      DecorList.add (new Decor(0, 300, 500, 25, 255, 165, 0));
      DecorList.add (new Decor(700, 300, 500, 25, 255, 165, 0));
      DecorList.add (new Decor(0, 200, 1200, 25, 255, 165, 0));
      DecorList.add (new Decor(500, 100, 200, 25, 255, 165, 0));
    }
  }
}
</code></pre>

<hr />

<p>This is what I have :
<img src="http://forum.processing.org/two/uploads/imageupload/060/CVEX6O3QOYDH.png" alt="DK (1)" title="DK (1)" /></p>

<p>This is what it should look like (the orange ones)
<img src="http://forum.processing.org/two/uploads/imageupload/803/CGM7FVQWZTR2.png" alt="DK (2)" title="DK (2)" /></p>
]]></description>
   </item>
   <item>
      <title>How to Link generated objects with a moving character?</title>
      <link>https://forum.processing.org/two/discussion/22847/how-to-link-generated-objects-with-a-moving-character</link>
      <pubDate>Wed, 31 May 2017 19:54:36 +0000</pubDate>
      <dc:creator>dcolwell18</dc:creator>
      <guid isPermaLink="false">22847@/two/discussions</guid>
      <description><![CDATA[<p>I am creating a code in which we are trying to link a character, in this case Mario, with a sequence of randomly generated blocks. We have created a system of generation for the blocks, but are having trouble having Mario interact with them and stop on the blocks. Any suggestions? Currently the blocks are generated on a series of timers, and his interactions with them are controlled by a series of if statements determining Mario's position. Any suggestions?</p>
]]></description>
   </item>
   <item>
      <title>3D TowerDefense game</title>
      <link>https://forum.processing.org/two/discussion/22586/3d-towerdefense-game</link>
      <pubDate>Sun, 14 May 2017 18:14:11 +0000</pubDate>
      <dc:creator>JtheDroid</dc:creator>
      <guid isPermaLink="false">22586@/two/discussions</guid>
      <description><![CDATA[<p>Hi,</p>

<p>I just found this "Share your work" category so I thought i could share my last Processing project, as I put quite some work in it.</p>

<p>It is, as the title might suggest, a tower defense game in 3D.
I put some more details in the <a rel="nofollow" href="https://github.com/JtheDroid/towerdefense-3D-processing">GitHub</a> README:</p>

<blockquote class="Quote">
  <p>A tower defense game made in Processing - download at <a href="https://processing.org/download/" target="_blank" rel="nofollow">https://processing.org/download/</a></p>
  
  <p>This is a tower defense game that I created for my computer science / IT class. Basically it's just a 2D interface floating in a 3D space with a 3D "terrain" laid over it.</p>
  
  <p>It it possible to create paths for the enemies and export them by pressing 'x' on the keyboard (prints a line of code that can be pasted in a function to permanently add the path.</p>
  
  <p>Most comments are in German, they were added to explain reasons for specific code to my teacher. For the code itself, e.g. variables or methods, I decided to use English names to avoid the ugly mix of English and German</p>
  
  <p>More information under 'Info' in the game's menu</p>
  
  <p>If you are experiencing performance issues or want the terrain to look nicer, you can adjust the quality variables in the main sketch file.</p>
</blockquote>

<p>If you want to try it out, <a rel="nofollow" href="https://github.com/JtheDroid/towerdefense-3D-processing">you can find it on GitHub</a>
<a rel="nofollow" href="https://github.com/JtheDroid/towerdefense-3D-processing/archive/master.zip">or just directly download it</a></p>

<p>If you'd prefer that, I also copied all the code in a single file: <a rel="nofollow" href="https://gist.github.com/JtheDroid/814ad3d463e0b537ee3ac4bf168b6659">GitHub Gist</a></p>

<p>Here are some images:</p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/800/VE42MTOA4CMC.png" alt="Base Profile 05.14.2017 - 17.20.02.08 (2)" title="Base Profile 05.14.2017 - 17.20.02.08 (2)" /></p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/428/R2ODYIE4R6QE.png" alt="Base Profile 05.14.2017 - 17.22.09.09 (2)" title="Base Profile 05.14.2017 - 17.22.09.09 (2)" /></p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/181/K7DBKM6PL3PQ.png" alt="Base Profile 05.14.2017 - 17.35.16.15" title="Base Profile 05.14.2017 - 17.35.16.15" /></p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/643/3QP0I0HI3PJW.png" alt="Base Profile 05.14.2017 - 17.35.05.13" title="Base Profile 05.14.2017 - 17.35.05.13" /></p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/575/XCILD15UDN8X.png" alt="Base Profile 05.14.2017 - 19.32.52.19" title="Base Profile 05.14.2017 - 19.32.52.19" /></p>

<p>Sadly, I didn't have enough time for designing models for enemies or towers before I had to hand in the finished program, so they're all just spheres.</p>

<p>Enjoy!</p>
]]></description>
   </item>
   <item>
      <title>My learning projects in video games</title>
      <link>https://forum.processing.org/two/discussion/22509/my-learning-projects-in-video-games</link>
      <pubDate>Wed, 10 May 2017 23:36:24 +0000</pubDate>
      <dc:creator>LoubiTek</dc:creator>
      <guid isPermaLink="false">22509@/two/discussions</guid>
      <description><![CDATA[<p>It's been a long time since I wanted to program video games!</p>

<p>After having a hard time trying different programming languages ​​(C / C ++, Lua, Batch, Python) which made me lose a lot of time. It was mainly with Processing that I finally realized something concrete. And just for that I am proud and I love this language simplify Java that I do not however especially specially in itself. ^^ I have managed to prototype some "dirty and incorrect" two projects at the moment. Or I gradually increase and reuse what I learned to improve as I go along and evolve my way of coding.</p>

<p>I am above all an artist (Audio / Mao / Sound desiner / ...) | (Graphic designer / 2D who really do not know how to draw (I like the use of filters especially), as well as a bit of 3D low poly textured) | Try Level Design / Map and Skybox. And I have a logical mind too. (Hence the interest for research, experimentation and the flow of information that I absorb night and day.) And it's perfect for my thirst for knowledge / creativity!</p>

<p>Not having attended math / physics classes that do not interest me in school.</p>

<p>Because too theoretical to my taste!</p>

<p>I've had to learn a lot of concept in any field that it artistic / logical or not and I love it! I really like everything that is psychedelic.
And in the future I would like to interest myself more to fractals.</p>

<p>But for now I have to learn the vectors / class and object paradigm.</p>

<p>Because my future projects should be cleaner and better structured to allow better readability / ease.</p>

<p>Here is my first project: <a href="https://github.com/LoubiTek/TestDevApp" target="_blank" rel="nofollow">https://github.com/LoubiTek/TestDevApp</a></p>

<p>Then the second: <a href="https://github.com/LoubiTek/Catch-Shuriken-s" target="_blank" rel="nofollow">https://github.com/LoubiTek/Catch-Shuriken-s</a></p>

<p>Both have explanations and comments!</p>

<p>Ah yes, I am French so sorry if there are any faults above.</p>
]]></description>
   </item>
   <item>
      <title>Voronoi game</title>
      <link>https://forum.processing.org/two/discussion/22418/voronoi-game</link>
      <pubDate>Sat, 06 May 2017 16:35:56 +0000</pubDate>
      <dc:creator>cameyo</dc:creator>
      <guid isPermaLink="false">22418@/two/discussions</guid>
      <description><![CDATA[<p>A simple game with the voronoi diagram (only a prototype for fun):<br />
Each player inserts, alternatively, a control point (voronoi point) to control a larger surface.<br />
The winner is the one who controls the largest surface after n turns.<br />
In the first round there is an area where checkpoints are prohibited.<br />
<img src="https://forum.processing.org/two/uploads/imageupload/852/FEPZ46D6BS67.png" alt="voroGAME" title="voroGAME" /><br />
<a rel="nofollow" href="https://www.dropbox.com/s/tasackoc3xfexce/voroGAME.zip?dl=0">Download</a><br />
Keys:<br />
'TAB' --&gt; new game<br />
'U' --&gt; undo move<br />
'T' --&gt; change euclidean/manhattan distance<br />
cameyo</p>
]]></description>
   </item>
   <item>
      <title>A BALL MANY COLORS game</title>
      <link>https://forum.processing.org/two/discussion/21487/a-ball-many-colors-game</link>
      <pubDate>Sun, 19 Mar 2017 23:28:03 +0000</pubDate>
      <dc:creator>jesusRodriguez</dc:creator>
      <guid isPermaLink="false">21487@/two/discussions</guid>
      <description><![CDATA[<p><img src="https://forum.processing.org/two/uploads/imageupload/755/1JVP5K5MXIN2.png" alt="vaadabaadgg_00000" title="vaadabaadgg_00000" /></p>

<p>Hey friends and processing community, I want to share a KickStarter campaign for an android video game that I have been developing along with some friends, the game is called '' Many Ball Colors ''. I also want to thank them for their contributions in Processing, they have All our support! If you want to make some contribution or contribution here is the link of the campaign in KickStarter :) Thank you very much!</p>

<p><a href="https://www.kickstarter.com/projects/862642805/a-ball-many-colors-game?ref=user_menu" target="_blank" rel="nofollow">https://www.kickstarter.com/projects/862642805/a-ball-many-colors-game?ref=user_menu</a></p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/002/C3ZZB67F2400.png" alt="fsbfffx_00000" title="fsbfffx_00000" /></p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/511/AHAYKEZU0RTO.png" alt="esta" title="esta" /></p>
]]></description>
   </item>
   <item>
      <title>A bunch of old games</title>
      <link>https://forum.processing.org/two/discussion/21456/a-bunch-of-old-games</link>
      <pubDate>Fri, 17 Mar 2017 17:06:16 +0000</pubDate>
      <dc:creator>cameyo</dc:creator>
      <guid isPermaLink="false">21456@/two/discussions</guid>
      <description><![CDATA[<p><img src="https://forum.processing.org/two/uploads/imageupload/968/QAO6QDLHHRJ7.png" alt="GAMES" title="GAMES" />
<a rel="nofollow" href="https://www.dropbox.com/s/jh44jbouqfd09if/p5GAMES.ZIP?dl=0">Download</a><br />
cameyo</p>
]]></description>
   </item>
   <item>
      <title>Fix text that is misplaced</title>
      <link>https://forum.processing.org/two/discussion/20375/fix-text-that-is-misplaced</link>
      <pubDate>Fri, 20 Jan 2017 14:48:19 +0000</pubDate>
      <dc:creator>BananaBunch</dc:creator>
      <guid isPermaLink="false">20375@/two/discussions</guid>
      <description><![CDATA[<p>Every time I fail and press R to restart the startup text is very off coordinate to where it is when it first starts up.</p>

<pre><code>/* How to Play : Use arrow-keys and press the key shoutcasted by the window (e.g. Press left if it says "! Left !").
 You win once you've reached a win streak of 20. You lose if you reach 0 HP.*/
import ddf.minim.*;
AudioPlayer spl;
Minim song;
PImage imgChrome, imgChrome2;

String[] symDanceKeys = {"←", "→", "↑", "↓"};
String[] ltrDanceKeys = {"Left", "Right", "Up", "Down"};

String cLTRSkey = "A";
String currentSYMkey = "←";
String cSk = currentSYMkey;
String currentLTRkey = "Left";
String cLk = currentLTRkey;

int aSec; 
int emoHP = 0;
int emoExpression = 0;
int danceStreak = 0;
int displayKeyX = 50;
int displayKeyY = 60;

boolean paused = false;
boolean tMin=false; //Timer minutes
boolean ending = false;
boolean displayKeyPressed=true;
boolean startScreen=false;
boolean winGame=false;
boolean endScreen=false;
boolean easy=false;
boolean medium=false;
boolean hard=false;
boolean expert=false;

float danceDiff = 2;
float timer = 0; // in seconds.
float sTimer; //Screen timer
float suTimer; //Startup Text timer
float dTimer; //Difficulty timer
float splTimer; // Song timer

PFont ar;

void setup() {
  song = new Minim(this);
  spl = song.loadFile("Tet.mp3");
  imgChrome2 = loadImage("chrome2.jpg");
  imgChrome = loadImage("chrome.jpg");
  background(#C6ba32);
  ar = createFont("ArialMT-48", 14, true);
  size(800, 500);
  frameRate(60);
}

void draw() {
  //if (splTimer&gt;=4) {
  //  spl.play();
    //spl.loop(-0);
  //}
  splTimer += 0.0166666667;
  suTimer += 0.0166666667;
  dTimer += 0.0166666667;
  if (suTimer&lt;=4) {
    startScreen=true;
  }
  if (startScreen) {
    textSize(14);
    fill(#00E8FF);
    noStroke();
    quad (30, 15, 500, 15, 480, 130, 10, 130);
    fill(#000000);
    text("To play, press the keys you're asked to press", 30, 30);
    text("as they are scrolling down the screen.", 30, 45);
    text("The more you press the correct key, the fast it gets.", 30, 60);
    text("The more you press the wrong key, your HP goes down.", 30, 75);
    text("If your HP hits 0, game over, but if your streak hits 20, you win!", 30, 90);
    text("Press the keys 1-4 on the startup screen to change the difficulty.", 30, 105);
    text("Press nothing for Super Easy mode!", 30, 120);
    if (suTimer&gt;=4) {
      startScreen=false;
    }
  }

  textFont(ar, 14);
  if (ending) {
    endScreen=true;
    background(#C6ba32);
    displayText("Press R to restart the game!", (310));
    displayText("The game has ended..", (230));
    String endingText = "";
    if (winGame) {
      endScreen=true;
      endingText = "You have won the game, Congrats! ( ͡° ͜ʖ ͡°)";
    } else {
      endingText = "You have lost the game, You suck! ( ͡° ʖ̯ ͡°)";
    }
    displayText(endingText, (270));
    delay(500);
  } else {
    // Since the frameRate is 60, to calculate 1 second, add by 1/60 everytime draw() runs.
    //vv|LOOK HERE FOR TIMER|vv\\  
    timer += 0.0166666667;
    if (timer &gt;=4 ) {
      println(mouseX+"X", mouseY+"Y");
      println( width+"W", height+"H");
      timer = 0;

      //^^|LOOK HERE FOR TIMER|^^\\

      if (displayKeyPressed) {
        // Selects a random number between 0 and the length of the danceKeys array/table.
        //vv|LOOK HERE FOR RANDOMIZER|vv\\
        int randomKey = int(random(ltrDanceKeys.length));
        cLk = ltrDanceKeys[randomKey];
        cSk = symDanceKeys[randomKey];
        //^^|LOOK HERE FOR RANDOMIZER|^^\\
        displayKeyY = 60;
        displayKeyX = int(random(50, width - 50));
        displayKeyPressed = false;
        text(cSk + cSk + cLk + cSk + cSk, displayKeyX, displayKeyY);
      } else {
        displayKeyPressed = true;
      }
    }
    // If four seconds hasn't passed yet..
    else if (!displayKeyPressed) {
      //Resets the background so the moving text effect is more pleasing.
      background(#C6ba32);
      drawEmoticon(emoExpression);

      displayKeyY += danceDiff;

      // If it reaches the bottom, you can't press the assigned key anymore.
      if (displayKeyY &gt;= (height - 30)) {
        displayKeyPressed = true;
      } else {
        textSize(14);

        // Creates a wind effect after dance streak reaches 16.
        if (danceStreak &gt;= 16) {
          for (int i = 1; i &lt;= (danceStreak - 15); i++) {
            fill(0, ((4 - i) * 30));
            text(cSk + cSk + cLk + cSk + cSk, int(random(displayKeyX - 30, displayKeyX + 30)), displayKeyY - (i * 20));
          }
        }
        fill(0);
        textSize(20);
        text(cSk + cSk + cLk + cSk + cSk, displayKeyX, displayKeyY);
      }

      displayBars();
      displayHealth();
    }
    fill(#FFFFFF);
    //quad(1 x, 1 y, 2 x, 2 y, 3 x, 3 y, 4 x, 4 y);
    quad(676, 443, 737, 443, 737, 458, 676, 458);
    quad(676, 430, 737, 430, 737, 444, 676, 444);
    textSize(10);
    fill(#000000);
    text("Mins | Sec", 707, 440);
    textSize(14); 
    sTimer +=0.0166666667;
    //If sTimer is 0
    if (sTimer &gt;=0) {
      //Display timer
      fill(#000000);
      text(sTimer, 711, 457);
    }
    if (sTimer&gt;=60.000) {
      tMin = true;
      sTimer=0;
    }
    //If tMin is true
    if (tMin) {
      tMin=false;
      //Add a minute to the timer
      fill(#000000);
      text(aSec+".", 685, 457);
      aSec = aSec + 1;
    }
    if (sTimer&gt;=0.000) {
      fill(#000000);
      text(aSec+".", 683, 457);
    }
  }
}

void keyPressed() {
  if (key=='r'||key=='R') {
    if (endScreen==true) {
      restart();
    }
  }
  if (key=='1') {
    if (dTimer&lt;=4) {
      easy=true;
      medium=false;
      hard=false;
      expert=false;
      fill(#ffffff);
      quad(50, 420, 128, 420, 128, 440, 50, 440);
      fill(#000000);
      text("EASY", 70, 435);
    } else {
      if (dTimer&gt;=4) {
        println("Cannot change difficulty at this time.");
      }
    }
  }
  if (key=='2') {
    if (dTimer&lt;=4) {
      easy=false;
      medium=true;
      hard=false;
      expert=false;
      fill(#ffffff);
      quad(50, 420, 128, 420, 128, 440, 50, 440);
      fill(#000000);
      text("MEDIUM", 60, 435);
      emoHP=8;
      danceDiff=3;
    } else {
      if (dTimer&gt;=4) {
        println("Cannot change difficulty at this time.");
      }
    }
  }
  if (key=='3') {
    if (dTimer&lt;=4) {
      easy=false;
      medium=false;
      hard=true;
      expert=false;
      fill(#ffffff);
      quad(50, 420, 128, 420, 128, 440, 50, 440);
      fill(#000000);
      text("HARD", 70, 435);
      emoHP=4;
      danceDiff=6;
    } else {
      if (dTimer&gt;=4);
      println("Cannot change difficulty at this time.");
    }
  }
  if (key=='4') {
    if (dTimer&lt;=4) {
      easy=false;
      medium=false;
      hard=false;
      expert=true;
      fill(#ffffff);
      quad(50, 420, 128, 420, 128, 440, 50, 440);
      fill(#000000);
      text("EXPERT", 60, 435);
      emoHP=1;
      danceDiff=10;
    } else {
      if (dTimer&gt;=4) {
        println("Cannot change difficulty at this time");
      }
    }
  }
  if (key=='P'||key=='p') {
    paused=true;
    noLoop();
    textSize(24);
    fill(#00E8FF);
    rect(335, 190, 160, 100);
    fill(#000000);
    text("Paused", 415, 245);
    textSize(12);
    text("Press ENTER to continue", 415, 280);
  } else {
    if (keyCode==ENTER&amp;&amp;paused==true) {
      paused=false;
      background(#C6ba32);
      drawHead();
      displayBars();
      displayHealth();
      draw();
      clear();
      loop();
    }
    // Problem #1; How2 detect WASD keys?
    if (!displayKeyPressed) {
      if (keyCode == LEFT) {
        if (cLk == ltrDanceKeys[0]) { // Selects the first (0) value from the danceKeys array.
          //println(danceKeys[0]) == String "Left"
          changeHealth(1);
        } else {
          paused=false;
          changeHealth(-1);
        }
      } else if (keyCode == RIGHT) {
        if (cLk == ltrDanceKeys[1]) {
          changeHealth(1);
        } else {
          paused=false;
          changeHealth(-1);
        }
      } else if (keyCode == UP) {
        if (cLk == ltrDanceKeys[2]) {
          changeHealth(1);
        } else {
          changeHealth(-1);
        }
      } else if (keyCode == DOWN) {
        if (cLk == ltrDanceKeys[3]) {
          changeHealth(1);
        } else {
          changeHealth(-1);
        }
      }
    }
  }
}

void changeHealth(int num) {
  displayKeyPressed = true;
  emoHP = emoHP + num;

  // Check if win or lose.
  //VV||MAX HP||VV\\
  if (emoHP &gt; 10) {
    emoHP = 10;
    //^^||MAX HP||^^\\
  } else if (emoHP &lt;= 0) {
    println("Game over!");
    ending = true;
  }
  if (danceStreak &gt;= 20) {
    println("You have won the game!");
    ending = true;
    winGame = true;
    endScreen = true;
  }

  // Checking win streaks for Difficulty Management and Emoticon Control.
  if (num &gt;= 0) {
    danceStreak ++;
    emoExpression = 0;
  } else {
    danceStreak --;
    emoExpression = 1;
    if (danceStreak&lt;=0) {
      danceStreak=0;
    }
  }
  if (danceStreak&lt;=1 &amp;&amp; easy==true) {
    danceDiff = 2;
  } else {
    if (danceStreak &gt;2&amp;&amp; easy==true) {
      danceDiff = danceStreak;
    }
  }
  if (danceStreak &lt;= 1 &amp;&amp; medium==true) {
    danceDiff = 3;
  } else {
    if (danceStreak &gt;=3 &amp;&amp; medium==true) {
      danceDiff = danceStreak;
    }
  }
  if (danceStreak &lt;= 1 &amp;&amp; hard==true) {
    danceDiff = 6;
  } else {
    if (danceStreak &gt;=6 &amp;&amp; hard==true) {
      danceDiff = danceStreak;
    }
  }
  if (danceStreak&lt;=1 &amp;&amp; expert==true) {
    danceDiff = 10;
    if (danceDiff &gt; 10) {
      danceDiff = 10;
    }
  }
  // This is to prevent that "freezing" effect that occurs when a key is pressed (due to timer use).
  background(#C6ba32);

  drawEmoticon(emoExpression);
  displayBars();
  displayHealth();
}

void displayBars() {
  noStroke();
  fill(150);
  rect(0, 0, width, 30);
}

void displayHealth() {
  noStroke();
  fill(150);
  rect(0, 0, width, 30);

  fill(250, 250, ((10 - emoHP) * 10) + 100);

  // Using algebra to determine how long the HP bar should be.
  int totalTopBarLen = width;
  int healthBarLen = (totalTopBarLen / 10) * emoHP;
  rect(0, 0, healthBarLen, 30);
  displayText("(" + emoHP + " HP) (" + danceStreak + " Streak) (" + danceDiff + " Diff)", 20);
}
void displayText(String str, int y) {
  fill(0);
  textSize(16);
  textAlign(CENTER);
  text(str, width / 2, y);
}

//This uses math to make the faces
void drawEmoticon(int faceNum) {
  drawHead();

  // Mouth
  if (faceNum == 0) {
    if (emoHP &lt;= 6) {
      line((width / 2) - 20, (height / 2) + 50, (width / 2) + 20, (height / 2) + 50);
    } else {
      // Arithmetic sequences formulae used to calculate the mouth-thingys' lengths.
      int mouthLenX = ((-5) + (emoHP - 1) * 5);
      int mouthLenY = ((75) + (emoHP - 1) * -5);
      line(width / 2, (height / 2) + 60, (width / 2) - mouthLenX, (height / 2) + mouthLenY);
      line(width / 2, (height / 2) + 60, (width / 2) + mouthLenX, (height / 2) + mouthLenY);
    }
  } else if (faceNum == 1) {
    line((width / 2) - 20, (height / 2) + 50, (width / 2) + 20, (height / 2) + 50);
    if (emoHP &lt;= 6) {
      int mouthLenX = (50 + ((emoHP - 1) * -4));
      int mouthLenY = (80 + ((emoHP - 1) * -4));
      line((width / 2) - 20, (height / 2) + 50, (width / 2) - mouthLenX, (height / 2) + mouthLenY);
      line((width / 2) + 20, (height / 2) + 50, (width / 2) + mouthLenX, (height / 2) + mouthLenY);
    }
  }
}

void drawHead() {
  // Head
  noStroke();
  fill(250, 250, ((10 - emoHP) * 10) + 100); // Changes face-paleness according to health.
  ellipse(width / 2, height / 2, width / 3, width / 3);

  // Eyes
  stroke(50);
  strokeWeight(5);
  ellipse((width / 2) - 40, (height / 2) - 30, 20, 20);
  ellipse((width / 2) + 40, (height / 2) - 30, 20, 20);
}
void restart() {
  background(#C6ba32);
  danceDiff = 2;
  timer = 0; // in seconds.
  sTimer = 0; //Screen timer
  suTimer = 0; //Startup Text timer
  dTimer = 0; //Difficulty timer
  splTimer = 0; // Song timer
  paused = false;
  tMin=false; //Timer minutes
  ending = false;
  displayKeyPressed=true;
  startScreen=false;
  winGame=false;
  endScreen=false;
  easy=false;
  medium=false;
  hard=false;
  expert=false;
  aSec = 0; 
  emoHP = 10;
  emoExpression = 0;
  danceStreak = 0;
  endScreen=false;
  redraw();
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Could someone help me with my tetris game?</title>
      <link>https://forum.processing.org/two/discussion/19506/could-someone-help-me-with-my-tetris-game</link>
      <pubDate>Sun, 04 Dec 2016 15:32:57 +0000</pubDate>
      <dc:creator>Rophi</dc:creator>
      <guid isPermaLink="false">19506@/two/discussions</guid>
      <description><![CDATA[<p>I fixed the problem myself now, don't need help anymore. (Don't know hot to delete it)</p>
]]></description>
   </item>
   <item>
      <title>Game Code Need Help</title>
      <link>https://forum.processing.org/two/discussion/19658/game-code-need-help</link>
      <pubDate>Sun, 11 Dec 2016 12:12:47 +0000</pubDate>
      <dc:creator>Albkad</dc:creator>
      <guid isPermaLink="false">19658@/two/discussions</guid>
      <description><![CDATA[<p>Hey, I have tried to make a cool code of a simple game but the flowers in the game doesnt seem to spawn.</p>

<pre><code>var ship;
var flowers = [];
var drops = [];

function setup() {
  createCanvas(600, 400)
  ship = new Ship();
  drop = new Drop(width/2, height/2);
  for (var i = 0; i &lt; drops.length; i++) {
    flowers[i] = new Flower(i*80+80, 60);
 }
}
function draw() {
  background(51)
  ship.show();

    for (var i = 0; i &lt; drops.length; i++) {
    drops[i].show();
    drops[i].move();
  }

  for (var i = 0; i &lt; flowers.length; i++) {
    flowers[i].show();
  }
}

function keyPressed() {
  if (key === ' ') {
    var drop = new Drop(ship.x, height);
    drops.push(drop);
  }



  if (keyCode === RIGHT_ARROW) {
    ship.move(1);
  } else if (keyCode === LEFT_ARROW) {
    ship.move(-1);
  }
}



function Ship() {
  this.x = width/2;


  this.show = function() {
    fill(255);
    rectMode(CENTER);
    rect(this.x, height-20, 20, 60);
  }

  this.move = function(dir) {
    this.x += dir*30;
  }
}

function Flower(x, y) {
  this.x = x;
  this.y = y;

  this.show = function() {
    fill(255, 0, 200);
    rectMode(CENTER);
    ellipse(this.x, this.y, 60, 60);
  }
}

function Drop(x, y) {
  this.x = x;
  this.y = y;

  this.show = function() {
    noStroke();
    fill(1, 0, 255);
    rectMode(CENTER);
    ellipse(this.x, this.y, 16, 16);
  }

  this.move = function() {
    this.y = this.y - 5;
  }
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>how to introduce speech recognition into game.</title>
      <link>https://forum.processing.org/two/discussion/16320/how-to-introduce-speech-recognition-into-game</link>
      <pubDate>Thu, 28 Apr 2016 15:26:59 +0000</pubDate>
      <dc:creator>luqman</dc:creator>
      <guid isPermaLink="false">16320@/two/discussions</guid>
      <description><![CDATA[<p>Hi,</p>

<p>I am currently working on a university final year project, where I am taking an existing piece of work and adding a useful element to it. I have started building the classic brick breaker game but I am not sure how can i use the speech-to-text library to introduce speech commands into the game, such as 'Run' to start the game and move the paddle by saying 'L' or 'R' (Left and Right).. I would like to configure the commands to the amount of pixels the paddle moves across..such as have default commands set as '30 pixels' and further commands such as 'L1' and 'R2' could be used to move a further distance '40pixels' maybe.</p>

<p>Thank you.</p>

<p>Current Code:</p>

<pre><code>        float ballX;        // x coordinate of the ball
        float ballY;        // y  coordinate of the ball
        float ballW;        // width of the ball
        float ballH;        // height of the ball
        float moveBallX;    // move the ball from left to right randomly
        float moveBallY;    // move the ball from top to bottom randomly
        float paddleX;      // x coordinate of the paddle
        float paddleY;      // y coordinate of the paddle
        float paddleW;      // width of the paddle
        float paddleH;      // height of the paddle
        float movePaddleX;  // move the paddle left or right by 30 pixels



        void setup () {

          size (350, 400);

          // Ball parameters; initial x, y coordinates, and width, height of the ball.
          ballX = 20;
          ballY = 20;
          ballW = 15;
          ballH = 15;

          // Move the ball's coordinate positions randomly in the game.
          moveBallX = random(1, 4); 
          moveBallY = random(1, 4);

          // Paddle parameters; initial x, y coordinates, and width, height of the paddle.
          paddleX = width/2;       
          paddleY = height - 20;
          paddleW = 50;
          paddleH = 10;

          // Move the Paddle's coordinate position
          movePaddleX = 30;
        }

        void draw () {
          background (0);
          ellipse (ballX, ballY, ballW, ballH); // ball
          noStroke();
          rect (paddleX, paddleY, paddleW, paddleH); // paddle

          // Add the moving motion to the ball.
          ballX = ballX + moveBallX;    //the current x position of the ball is moved by the variable moveBallX.
          ballY = ballY + moveBallY;    ///the current y position of the ball is moved by the variable moveBallY.


          //IF statements to control the ball's x coordinate, rebounce the ball when it hits the right or left edge.

          if (ballX &gt; width) {
            moveBallX = -moveBallX; // The values become the opposite, and allow a rebounce.
          }

          if (ballX &lt; 0) {

            moveBallX = -moveBallX;  // The values become opposite, and allow a rebounce.
          }

          //IF statements to control the ball's y, rebounce the ball when it hits the top or bottom edge.

          if (ballY &gt; paddleY)       // 'paddleY' is used instead of 'height'. to show a bounce on the paddle.
          {
            moveBallY = -moveBallY; // The values become the opposite, and allow a rebounce.
          }

          if (ballY &lt; 0) {           

            moveBallY = -moveBallY; // The values become the opposite, and allow a rebounce.
          }

        }

        void keyPressed() {
          if (key == CODED) {
            if (keyCode == LEFT) {         //when the LEFT key is pressed, the paddle is moved to the left by 30 pixels.

              paddleX = paddleX - movePaddleX;
            } else if (keyCode == RIGHT) {  //when the RIGHT key is pressed, the paddle is moved to the right by 30 pixels.

              paddleX = paddleX + movePaddleX;
            }
          }
        }


        //Help acquired from the following sources:
        //<a href="https://processing.org/examples/" target="_blank" rel="nofollow">https://processing.org/examples/</a>
        //<a href="http://www.openprocessing.org/sketch/134612" target="_blank" rel="nofollow">http://www.openprocessing.org/sketch/134612</a>  
        //<a href="http://drdoane.com/thinking-through-a-basic-pong-game-in-processing/" target="_blank" rel="nofollow">http://drdoane.com/thinking-through-a-basic-pong-game-in-processing/</a> 
</code></pre>

<blockquote class="Quote">
  
</blockquote>
]]></description>
   </item>
   <item>
      <title>Review my game</title>
      <link>https://forum.processing.org/two/discussion/14219/review-my-game</link>
      <pubDate>Sat, 02 Jan 2016 01:30:30 +0000</pubDate>
      <dc:creator>ProcessingJava</dc:creator>
      <guid isPermaLink="false">14219@/two/discussions</guid>
      <description><![CDATA[<p>Guys, please review my game because I have spent a lot of time on it, rate it out of 10. Make edits if necessary and I would appreciate your efforts. This is the link for the game, download it from dropbox, Thanks.</p>

<p><a href="https://www.dropbox.com/sh/ib2450ctb45c9z3/AABICpO1Tpq0xhKiC1Ths8kCa?dl=0" target="_blank" rel="nofollow">https://www.dropbox.com/sh/ib2450ctb45c9z3/AABICpO1Tpq0xhKiC1Ths8kCa?dl=0</a></p>
]]></description>
   </item>
   <item>
      <title>Game menu with images</title>
      <link>https://forum.processing.org/two/discussion/18621/game-menu-with-images</link>
      <pubDate>Wed, 19 Oct 2016 15:29:55 +0000</pubDate>
      <dc:creator>vamo1986</dc:creator>
      <guid isPermaLink="false">18621@/two/discussions</guid>
      <description><![CDATA[<p>Hi everyone! i am really really reaaaaalllly new at processing.
I am trying to build a menu for my game in which the user clicks the mouse button and the game shows an image.
The problem is that when I run the program it show the first image and then when i clikc on an specific area it shows the las image, excluding states 1 and 2. Can anyone tell me whats wrong with my code? Thanks a lot!</p>

<pre><code>PImage img1;
PImage img2;
PImage img3;
PImage img4;
final int empezar = 0;
final int roles = 1;
final int instrucciones = 2;
final int asignar = 3;
int paginaActual = 0;
boolean botonPresionado = false;

void setup () {
  size (648, 480);
  img1 = loadImage ("Titulo2.jpg");
  img2 = loadImage ("Roles.jpg");
  img3 = loadImage ("Instrucciones.jpg");
  img4 = loadImage ("Asignar.jpg");
}

void draw () {

  switch (paginaActual) {

  case empezar:

    drawParaEmpezar ();
    break;

  case roles:

    drawParaRoles ();
    break;

  case instrucciones:
    drawParaInstrucciones ();
    break;

    //  case asignar:
    //   drawParaAsignar ();
    //  break;

  default: 
    println ("estado no identificado");
    break;
  }
}
void drawParaEmpezar () {
  image (img1, 0, 0);
  if (botonPresionado) 
  {
    drawParaRoles ();
  }
}

void drawParaRoles () {
  image (img2, 0, 0);
  if (botonPresionado) 
  {
    drawParaInstrucciones ();
  }
}

void drawParaInstrucciones () {
  image (img3, 0, 0);
  if (botonPresionado) 
  {
    image (img4, 0, 0);
  }
}

// void drawParaAsignar () {
//   image (img4, 0, 0);
// }

void mousePressed()
{ 
  switch (paginaActual) {

  case empezar:
    mousePressedParaEmpezar ();
    break;

  case roles:
    mousePressedParaRoles ();
    break;

  case instrucciones:
    mousePressedParaInstrucciones ();
    break;
  }
}

void mousePressedParaEmpezar () {
  if (  mouseX &gt; 250 &amp;&amp; mouseX &lt; 391 &amp;&amp; mouseY &gt; 277 &amp;&amp; mouseY &lt; 325 ) 
  {
    botonPresionado = !botonPresionado;
  } else {
  }
}

void mousePressedParaRoles () {
  if (  mouseX &gt; 473 &amp;&amp; mouseX &lt; 620 &amp;&amp; mouseY &gt; 408 &amp;&amp; mouseY &lt; 456 ) 
  {
    botonPresionado = !botonPresionado;
  } else {
  }
}

void mousePressedParaInstrucciones () {
  if (  mouseX &gt; 473 &amp;&amp; mouseX &lt; 620 &amp;&amp; mouseY &gt; 408 &amp;&amp; mouseY &lt; 456 ) 
  {
    botonPresionado = !botonPresionado;
  } else {
  }
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Dot.Connect: new Android game</title>
      <link>https://forum.processing.org/two/discussion/15032/dot-connect-new-android-game</link>
      <pubDate>Sun, 21 Feb 2016 03:30:21 +0000</pubDate>
      <dc:creator>wit221</dc:creator>
      <guid isPermaLink="false">15032@/two/discussions</guid>
      <description><![CDATA[<p>Hi!</p>

<p>I wanted to share with you Dot.Connect, an Android game that I made using Processing. You can find it here:</p>

<p><a href="https://play.google.com/store/apps/details?id=com.dlc.w.dotconnect" target="_blank" rel="nofollow">https://play.google.com/store/apps/details?id=com.dlc.w.dotconnect</a></p>

<p>I would highly appreciate if you could provide me with any feedback, that is, any bugs you encountered, any limitations you detect as well as any potential improvements you see.</p>

<p>But more importantly, I hope you enjoy.</p>
]]></description>
   </item>
   <item>
      <title>Random Speed in an array + looping objects in the Y axis</title>
      <link>https://forum.processing.org/two/discussion/18322/random-speed-in-an-array-looping-objects-in-the-y-axis</link>
      <pubDate>Wed, 28 Sep 2016 04:25:34 +0000</pubDate>
      <dc:creator>grandmajoe</dc:creator>
      <guid isPermaLink="false">18322@/two/discussions</guid>
      <description><![CDATA[<p>Hello, I am currently trying to make a game where objects float past the user constantly (current max objects on screen is 10).</p>

<p>I am using an array for these 'class Rocks' objects.</p>

<p>I however can't seem to make the objects in the array move at different speeds from each other, it appears to apply to the batch as a whole.</p>

<p>Also I can't figure out how to get the objects to loop back to the bottom and re-randomize their x-axis location + size upon reaching the top.</p>

<p>(I only have my toploop function and not the size and x-axis one as if I'm not wrong, it's based on the same idea and once I figure out toploop the rest should follow)</p>

<p>Here's my tab for the main sketch and subsequently the class Rocks tab</p>

<pre><code>Rock[] rocks = new Rock[10];


void setup() {
  size(500, 700);
  for (int i = 0; i&lt;10; i++) {
    rocks[i] = new Rock();
  }
}
void draw() {
  background(30);
  for (int i = 0; i&lt;10; i++) {
    rocks[i].appearance();
    rocks[i].rise();  }
}

class Rock {

  float x;
  float y;
  float rSize;
  float yspeed;

  Rock() {

    x = random(width);
    y = random(750, 1000);
    rSize = random(10, 50);
    yspeed = random(-1,-5);
  }

  void appearance() {
    fill(250);
    ellipse (x, y, rSize, rSize);
  }

  void rise() {
    y += yspeed;
  }

 /* void toploop() {

    if (y &lt;= 0); 
    y = random(750, 1000); 
    println(y);
  } */
}
</code></pre>

<p>I commented out the toploop function because it just kept assigning them a random value of y</p>

<p>I feel like i'm missing something really rudimentary but I'm also quite new to coding in general</p>

<p>Please and thank you in advance!</p>
]]></description>
   </item>
   </channel>
</rss>