How do I make upgrades for my player?

Game Engine, Players & Web Plug-in, Virtual Reality, support for other engines

Moderators: jesterKing, stiv

Jedijds
Posts: 126
Joined: Mon Jan 30, 2012 5:19 am

How do I make upgrades for my player?

Postby Jedijds » Thu Mar 01, 2012 2:36 pm

How could I make upgrades that my player could buy from a store? Could someone show me to a tutorial? Or make on?
۞◄█°‖‖‖‖‖█ʭʭ╬(░▒▓▓▒▒▒▒▒▒▒▒▒)

przemekk
Posts: 9
Joined: Tue Jan 25, 2011 9:08 am

Re: How do I make upgrades for my player?

Postby przemekk » Wed Apr 04, 2012 2:45 pm

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: Select all

# 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


Return to “Interactive 3d”

Who is online

Users browsing this forum: No registered users and 0 guests