Go Back   xda-developers > HTC Diamond: Touch Diamond, MDA Compact IV > Touch Diamond, MDA Compact IV Themes and Apps


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12th April 2009, 05:19 PM
l3v5y's Avatar
l3v5y l3v5y is offline
Moderator
 
Join Date: Sep 2007
Location: Bristol
Posts: 7,149
Default [APP][13/04/09] GravityPong - GSensor Pong 0.4

Another little game from me today.

This uses the same basic framework as BallPhysics, but applies it in a different way.

It's pong, where your paddle is controlled by tilting the device.



The controls:
Up/Down change the balls speed.
Left/Right change the CPU paddle speed
Centre pauses

The text:
In the bottom left is the time in milliseconds since the last restart
In the bottom right is the current score

Should work on Diamond, Raphael, Blackstone, Rhodium and Topaz.

It's written in C++/win32, so no nothing apart from the exe is needed.

Configuration:
Code:
HKCU\Software\l3v5y\GravityPong
FixedVelocity=

if < 0, velocity is variable, if > 0, FixedVelocity is the difference between the CPU speed and your paddle speed

Changelog
0.4 - uses trig to calculate the initial ball speed so the ball travels at one speed regardless of angle, some little performance tweaks
0.3 - adds configuration of speed, and exit if mouse is within top 40 pixels of screen.
0.2 - Fixes sensor polling, and possible odd background
0.1 - Initial release
Attached Images
File Type: jpg GP0.1.jpg (8.1 KB, 9859 views)
Attached Files
File Type: cab GravityPong.CAB (10.4 KB, 242 views)
File Type: cab GravityPong 0.2.CAB (9.9 KB, 45 views)
File Type: cab GravityPong 0.3.CAB (10.1 KB, 85 views)
File Type: cab GravityPong 0.4.CAB (10.4 KB, 4699 views)
__________________


My ROMs:
Diamond 28217/23529 + kitchen
Leo 28014 ROM - also, WMPowerUser HD2 ROM

My devices:
HTC Prophet - 23529 Light
HTC Diamond - 23529 Light
HTC Leo - getting repaired (for £155 )


Last edited by l3v5y; 13th April 2009 at 12:35 PM..
Reply With Quote
Sponsored Links

  #2  
Old 12th April 2009, 05:36 PM
johanromijn's Avatar
johanromijn johanromijn is offline
Senior Member
 
Join Date: Dec 2006
Location: NL@GMT[+1]
Posts: 904
Default

Nice!!!
I will try it right now!

[EDIT] The idea is nice, but controlling the paddle isn't working very well for me (it's almost not responding to my movements at all), and after 5 sec. it will be in a loop.
__________________
HTC Shift Windows 7 - Palm Treo 500v WM6 - HTC TyTN II WM6.1 - HTC Touch PRO WM6.1 - Samsung i780 WM6.1 - iPhone 3GS 16GB White

- If it jams, force it. If it breaks it probably needed replacing anyway. -

Last edited by johanromijn; 12th April 2009 at 05:45 PM..
Reply With Quote

  #3  
Old 12th April 2009, 06:08 PM
Joe_PDA Joe_PDA is offline
Senior Member
 
Join Date: Jul 2003
Posts: 199
Default

I loaded this game onto my Touch Pro. Here is what happened:

1. Worked for about 15 seconds. Then my paddle would not respond to any movement. I tried back and forth, up and down, side to side, hard and soft shaking.

2. Shut down and tried a soft reset. Started game again and all I got was a colorful static screen but could still see the paddle moving with its white tail in the fore ground. Did I describe that well enough to understand?

This game seems like it could be really cool but seems to have some issues.

Any ideas?
Reply With Quote

  #4  
Old 12th April 2009, 06:39 PM
l3v5y's Avatar
l3v5y l3v5y is offline
Moderator
 
Join Date: Sep 2007
Location: Bristol
Posts: 7,149
Default

Quote:
Originally Posted by Joe_PDA View Post
I loaded this game onto my Touch Pro. Here is what happened:

1. Worked for about 15 seconds. Then my paddle would not respond to any movement. I tried back and forth, up and down, side to side, hard and soft shaking.

2. Shut down and tried a soft reset. Started game again and all I got was a colorful static screen but could still see the paddle moving with its white tail in the fore ground. Did I describe that well enough to understand?

This game seems like it could be really cool but seems to have some issues.

Any ideas?
Okay.

I think I've found the cause of both of those.
1. I was polling the sensor too often causing it to try and check again before it had finished the previous check.
2. I haven't noticed this, but filling the background with a black fill should sort it.

Can you try the attached and see if it works?

Thanks
Attached Files
File Type: cab GravityPong 0.2.CAB (9.9 KB, 20 views)
__________________


My ROMs:
Diamond 28217/23529 + kitchen
Leo 28014 ROM - also, WMPowerUser HD2 ROM

My devices:
HTC Prophet - 23529 Light
HTC Diamond - 23529 Light
HTC Leo - getting repaired (for £155 )

Reply With Quote

  #5  
Old 12th April 2009, 06:45 PM
l3v5y's Avatar
l3v5y l3v5y is offline
Moderator
 
Join Date: Sep 2007
Location: Bristol
Posts: 7,149
Default

A question for potential users of this:

Anyone interested in the possibility of bluetooth based multiplayer?

As in, you pair with another HTC sensor enabled device and can control one paddle while the paired device controls the other?

I ask as I've just found some sample code in the WM6 SDK for "BthChat", that could provide the data transfer framework...
__________________


My ROMs:
Diamond 28217/23529 + kitchen
Leo 28014 ROM - also, WMPowerUser HD2 ROM

My devices:
HTC Prophet - 23529 Light
HTC Diamond - 23529 Light
HTC Leo - getting repaired (for £155 )

Reply With Quote

  #6  
Old 12th April 2009, 06:55 PM
johanromijn's Avatar
johanromijn johanromijn is offline
Senior Member
 
Join Date: Dec 2006
Location: NL@GMT[+1]
Posts: 904
Default

Tnx, works better now.
Still it's hard to get the paddle "stable", but it works.
__________________
HTC Shift Windows 7 - Palm Treo 500v WM6 - HTC TyTN II WM6.1 - HTC Touch PRO WM6.1 - Samsung i780 WM6.1 - iPhone 3GS 16GB White

- If it jams, force it. If it breaks it probably needed replacing anyway. -
Reply With Quote

  #7  
Old 12th April 2009, 06:57 PM
l3v5y's Avatar
l3v5y l3v5y is offline
Moderator
 
Join Date: Sep 2007
Location: Bristol
Posts: 7,149
Default

Quote:
Originally Posted by johanromijn View Post
Tnx, works better now.
Still it's hard to get the paddle "stable", but it works.
Would you prefer the sensitivity to be lower?

I could probably make it configurable, but I'd need a settings app/screen to do so. If wanted, I'll do it...
__________________


My ROMs:
Diamond 28217/23529 + kitchen
Leo 28014 ROM - also, WMPowerUser HD2 ROM

My devices:
HTC Prophet - 23529 Light
HTC Diamond - 23529 Light
HTC Leo - getting repaired (for £155 )

Reply With Quote

  #8  
Old 12th April 2009, 07:01 PM
johanromijn's Avatar
johanromijn johanromijn is offline
Senior Member
 
Join Date: Dec 2006
Location: NL@GMT[+1]
Posts: 904
Default

Quote:
Originally Posted by l3v5y View Post
Would you prefer the sensitivity to be lower?

I could probably make it configurable, but I'd need a settings app/screen to do so. If wanted, I'll do it...
Maybe it would be better that if you tilt your device to the left it will move to the left at a static speed. (not moving very fast if you tilt it more)
Now it's bouncing from all left to all right, it's hard to control.

I hope you get what I mean. Maybe it's just me who can't play this game :-)
__________________
HTC Shift Windows 7 - Palm Treo 500v WM6 - HTC TyTN II WM6.1 - HTC Touch PRO WM6.1 - Samsung i780 WM6.1 - iPhone 3GS 16GB White

- If it jams, force it. If it breaks it probably needed replacing anyway. -
Reply With Quote

  #9  
Old 12th April 2009, 07:05 PM
Joe_PDA Joe_PDA is offline
Senior Member
 
Join Date: Jul 2003
Posts: 199
Thumbs up Nicely done and fast too

Thanks for the lightening fast update. This is much better now. Really cool. Your are on to something really good here. A few comments:

1. I agree it is a bit hard to control. configurable would be the way to go.
2. Can you make the scoreboard a bit larger?
3. Maybe a pause button and exit button?
4. Bluetooth multiplayer would be a cool feature.

Based on your lightening fast work, can we expect the new version in the next 20 minutes?
just kidding . I have a short attention span.
Reply With Quote

  #10  
Old 12th April 2009, 07:09 PM
l3v5y's Avatar
l3v5y l3v5y is offline
Moderator
 
Join Date: Sep 2007
Location: Bristol
Posts: 7,149
Default

Quote:
Originally Posted by Joe_PDA View Post
Thanks for the lightening fast update. This is much better now. Really cool. Your are on to something really good here. A few comments:

1. I agree it is a bit hard to control. configurable would be the way to go.
2. Can you make the scoreboard a bit larger?
3. Maybe a pause button and exit button?
4. Bluetooth multiplayer would be a cool feature.

Based on your lightening fast work, can we expect the new version in the next 20 minutes?
just kidding . I have a short attention span.
Those updates were about 5 lines of code

1. Configurable is about 10 lines of code (it'll be registry based, I might make a config app later)
2. Scoreboard font size is one number, so that's easy.
3. Centre button on DPAD (or return on a keyboard) will pause it, although the timer in the bottom left may continue to run
4. That may take longer as I need to find a device I can test it on (I only have on Diamond, and my Prophet doesn't do gsensors..)
__________________


My ROMs:
Diamond 28217/23529 + kitchen
Leo 28014 ROM - also, WMPowerUser HD2 ROM

My devices:
HTC Prophet - 23529 Light
HTC Diamond - 23529 Light
HTC Leo - getting repaired (for £155 )

Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:52 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.