Click here to Skip to main content
Click here to Skip to main content

Ultraping Paddle Game

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

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

Introduction  

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 

Thoughts  

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. 

Gameplay 

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 

TouchEvent

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
{
    event.target.startTouchDrag(event.touchPointID, false, fl_DragBounds);
}

function fl_TouchEndHandler(event:TouchEvent):void
{
    event.target.stopTouchDrag(event.touchPointID);    
}

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.  

History  

1.0 Initial release  

1.1 bugfixes where I lost letters in the text 

License

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

About the Author

Folker_
Software Developer
Germany Germany
No Biography provided

Comments and Discussions

 
GeneralMy vote of 5 PinmemberFabse_net23-Oct-12 2:50 
GeneralMy vote of 5 PinmemberDen205023-Oct-12 1:35 
GeneralRe: My vote of 5 PinmemberFolker_23-Oct-12 1:47 
GeneralRe: My vote of 5 PinmemberDen205023-Oct-12 4:08 

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

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

| Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 4 Jun 2013
Article Copyright 2013 by Folker_
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid