Click here to Skip to main content
13,259,986 members (50,047 online)
Click here to Skip to main content
Add your own
alternative version


2 bookmarked
Posted 4 Jun 2013

Ultraping Paddle Game

, 4 Jun 2013
Rate this:
Please Sign up or sign in to vote.
Paddle-Ball multiplayer multitouch game for Ultrabooks.

Editorial Note

This article is an entry in our AppInnovation Contest. Articles in this sub-section are not required to be full articles so care should be taken when voting.


You know Pong and Breakout, you love those games and you have the new Ultrabook, so here is a multitouch paddle game you can play with your friends.

Windows 8 Game / Desktop App / AIR for Ultrabooks 


Thinking about using multitouch features of the Ultrabook I ask myself, what would I want to see on an Ultrabook. A game that makes more fun with touching a screen than using multiple keys on a board. Or which needs more than one mouse. 


Using two fingers in the marked area on the left for the left player and using two fingers in the right area for the second player. The paddle will have a fit size (when using no items maybe later in the game). If the puck  / ball touches the barrier on the sides, the player who is not on this side will get a point. Till how many points you want to play you can chose yourself.   

Why you should use it on an Ultrabook?    

Using keyboard keys wouldn't give you the flexibility of turning your paddle around in any angle. With the high performance of the Ultrabook I also can more graphic effects like particles or other features in the future without having the anger of slowing down. 

How does it works? 

Two  fingers on each side in the marked area. So I bounded the area for the touch events.   

If now touch event is in the area or more than two, the paddle will have a default position. If there is only one touch event in the area, the paddle will have a fixed angle. And if using two fingers in the area which gives two touch events in this area, a draw a imaginary line between these two touch-points. The paddle center is placed between the two touch-points and the  angle of the paddle is the angle of the imaginary line to one side of the hole field.  


I am using Flash Action Script 3.0 AIR 3.4 for Desktops   

Using the code 


So multitouch is like using drag and drop events.

Sample code:

Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;

paddle_ball_1.addEventListener(TouchEvent.TOUCH_BEGIN, fl_TouchBeginHandler);
paddle_ball_1.addEventListener(TouchEvent.TOUCH_END, fl_TouchEndHandler);

var fl_DragBounds:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);

function fl_TouchBeginHandler(event:TouchEvent):void
{, false, fl_DragBounds);

function fl_TouchEndHandler(event:TouchEvent):void

Game and Physics Engine 

For the game I am using no special engine. But for the physics I choose Box2D. It's simple to use and well documented.  


1.0 Initial release  

1.1 bugfixes where I lost letters in the text 


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer
Germany Germany
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 5 Pin
Fabse_net23-Oct-12 3:50
memberFabse_net23-Oct-12 3:50 
GeneralMy vote of 5 Pin
Den205023-Oct-12 2:35
memberDen205023-Oct-12 2:35 
GeneralRe: My vote of 5 Pin
Folker_23-Oct-12 2:47
memberFolker_23-Oct-12 2:47 
GeneralRe: My vote of 5 Pin
Den205023-Oct-12 5:08
memberDen205023-Oct-12 5:08 
Ok, so you are using a standard approach with joints. I am doing the same.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171114.1 | Last Updated 4 Jun 2013
Article Copyright 2013 by Folker_
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid