 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
zydeoN
Joined: 09 May 2009 Posts: 45
|
Posted: Fri Jun 26, 2009 12:58 am Post subject: [homebrew] Pong game Ad Hoc |
|
|
Hi, im working in a pong game, that can be played via ad hoc against another player. The source is fine, but there is a problem: im sending two different data at the same time to another psp, that are the position of the ball and the position of the paddles. In result, the movement of the ball (in the psp that receives the data from the other) is some kind of slow and with "breaks".
If i deleted the one of the sending data, for example, the position of the paddles, the movement of the ball would be perfect, with no breaks. So i suppose that the problem is in sending two different data at the same time. How can i solve the problem? I“ve heard about threads, is it going to help me ? |
|
| Back to top |
|
 |
Gefa
Joined: 13 Aug 2008 Posts: 12 Location: Italy
|
|
| Back to top |
|
 |
zydeoN
Joined: 09 May 2009 Posts: 45
|
Posted: Tue Jul 21, 2009 11:46 am Post subject: |
|
|
thats not so easy, because the Adhoc only accept strings and if i would pass the coordinates of each position i had to do:
If "x=0 and y = 13 " then
x = 0
y= 13
If " x == 0 and y == 14" then
x= 0
y = 14
.
.
.
and so on... I already made the homebrew, but the movement of the ball is not random xD Now, im making a prx that turns off psp when button is pressed, but i just cannot deal with it. if anyone can help me, please read the other topic i created :P |
|
| Back to top |
|
 |
Gefa
Joined: 13 Aug 2008 Posts: 12 Location: Italy
|
Posted: Sat Jul 25, 2009 7:31 pm Post subject: |
|
|
Anyway you didn't understand... You have to send a string like:
12,34,45,32
Where the first two numbers are the coordinates of the first ball; instead, the two latest are the coordinates of the second ball.
Then, you must split that string by passing as argument of division the char ",", obteining in this way the 4 numbers. Sorry for my bad english, have you understood? _________________ For my PSP project, visit my web site: www.gefa.altervista.org
PaintMIXER v2.6.0 released: http://www.neoflash.com/forum/index.php/topic,5253.0.html |
|
| Back to top |
|
 |
imhotep
Joined: 13 Dec 2005 Posts: 41
|
Posted: Mon Aug 10, 2009 6:55 pm Post subject: |
|
|
that's easy, just use strtok
create strings like for example for player 1:
100X50
then parse them with strtok with the delimiter 'X'
voilą |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|