Previous Thread  Next Thread

chat icon How do I make upgrades for my player?

Jedijds

Posted: Thu Mar 01, 2012 2:36 pm
Joined: 30 Jan 2012
Posts: 115
How could I make upgrades that my player could buy from a store? Could someone show me to a tutorial? Or make on?
_________________
۞◄█°‖‖‖‖‖█ʭʭ╬(░▒▓▓▒▒▒▒▒▒▒▒▒)
Reply with quote


przemekk

Posted: Wed Apr 04, 2012 1:45 pm
Joined: 25 Jan 2011
Posts: 9
Jedijds wrote:
How could I make upgrades that my player could buy from a store? Could someone show me to a tutorial? Or make on?


You can use Python httplib to communicate between blenderplayer and the website (with PHP and some database )

In that manner:
Code:

# needed for sending data routines
import httplib

#values we want to send
username = "JOHN"
score = 1230

print "connecting...",

# connect to the server just as the browser do - to the 80 port.
con = httplib.HTTPConnection("yoursite.com", 80)
print "ok"
print "sending request...",

# send the GET request, note the path to the script doesn't start from server name, the path is absolute.
# we send data after ? as variablename=variablevalue separated by &
con.request("GET", "/somescript.php?username="+str(username)+"&score="+str(score));
print "ok"

#get response from server -  status codes here: http://www.w3.org/Protocols/HTTP/HTRESP.html
# 200 means OK
resp = con.getresponse()
print resp.status, resp.reason
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group