forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[homebrew] Pong game Ad Hoc

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
zydeoN



Joined: 09 May 2009
Posts: 45

PostPosted: Fri Jun 26, 2009 12:58 am    Post subject: [homebrew] Pong game Ad Hoc Reply with quote

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
View user's profile Send private message
Gefa



Joined: 13 Aug 2008
Posts: 12
Location: Italy

PostPosted: Mon Jul 20, 2009 7:34 am    Post subject: Reply with quote

I guess you must send just a string, witch contains the coordinates of the balls and paddles, then you'll parse it obtaining the coordinates.
_________________
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
View user's profile Send private message Visit poster's website MSN Messenger
zydeoN



Joined: 09 May 2009
Posts: 45

PostPosted: Tue Jul 21, 2009 11:46 am    Post subject: Reply with quote

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
View user's profile Send private message
Gefa



Joined: 13 Aug 2008
Posts: 12
Location: Italy

PostPosted: Sat Jul 25, 2009 7:31 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
imhotep



Joined: 13 Dec 2005
Posts: 41

PostPosted: Mon Aug 10, 2009 6:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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