Im trying to have the user type in their player name and then they hit enter and it loads the array to a string but for some reason it's not working I really can't work it out im sure it's staring me in the face but i just can't crack it, please help :)
Hey all, I couldn't be more confused, I'm tying to get processing to load up a php script and send the int vaule of score to it but it's kicking out an error about the url, here is the code, the php and the error msg:
{
loopcheck2 = 1;
String url ="score.php" + score; // i've tried my site as the url "www.epiphanystudios.co.uk/score.php" still get errors
loadStrings(url);
}
error: The file "score.php1" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.
here is the PHP:
<?php
session_start();
$score = $_GET['score'];
$connect = mysql_connect('','',''') or die("couldn't connect");
mysql_select_db("test")or die("can't find ya database fool!");
$query = ("SELECT rank FROM players WHERE player_name = '{$_SESSION['player_name']}'");
$dbscore = mysql_query($query);
if($score > $dbscore)
{
mysql_query("UPDATE score SET score = '$score'
WHERE player_name = '{$_SESSION['player_name']}'");
Just thought I would share my game with you all, it is very simple, and wouldn't take you all that long to code up a version yourselves I'm sure, but this an original creation from Epiphany and we see fun addictive play with the game. It's still in devlopment but features on the site, a leaderboard system is still being worked out as I write this so I hope to see a few of your names on there in times to come! Anyway with out further ado I give you [LASER]
2 :http://www.epiphanystudios.co.uk/code.php
P.S works best in Chrome IE tends to hate whatever we build :(
Hey all i'm trying to create an app that will work when the user is logged in on my site and the session is started but im not sure what the syntax is for it in processing, at present the code runs when you boot from the local machine but I get class not found errors when I try to run it on the site, so I can't actually test it. Any ideas would be gratefully appreciated.
Thanks, Harrison
here is the problem block:
code:
if ( dbconnection.connect() )
{
// now read it back out
//
dbconnection.query( "SELECT score FROM players WHERE player_name = '{$_SESSION['player_name]'}" );
while (dbconnection.next())
{
dbscore = dbconnection.getInt("score");
if(dbscore < score)// if the db score is lower than the new we update it.
{
dbconnection.execute(" UPDATE players SET score ='"+score+"' WHERE player_name = '{$_SESSION['player_name]'}");
I'm trying to build a leader board type system for a game I've built, but I can't seem to work it out, I tired the MySQL route and that lead to a over complicated and impractical solution. Any ideas? I would need to save it to a database I assume because I would have to query top 10 for example. I would need to export the score(int) and the player name (8 bit string)
Just wondering if anyone can guide with my code I've sort of got it working but it's not perfect I'm trying to make it so the smaller Square is detected as soon as any part of it enters the area of the bigger one but I have no clue how to do that.
I'm trying to get an applet of mine to run on my website, but the java console just spits out a ton of errors all saying the class cannot be loaded is this a common problem is there a simple fix?
Simple Game, i want the ballto bounce of the rectangle, but for some reason(most likely obvious) it just floats pass :( here is the code and thank you for your help!!
Harrison.
float x = 400; // postion of the player
float y = 193; //postion of player
float speed = 10; // movement of player speed
int size = 20; // Width of the shape
float xpos, ypos; // Starting position of shape
float xspeed = 2.8; // Speed of the shape
float yspeed = 2.2; // Speed of the shape
int xdirection = 1; // Left or Right
int ydirection = 1; // Top to Bottom
int score = 50;
void setup()
{
size(640, 200);
noStroke();
frameRate(30);
smooth();
// Set the starting position of the shape
xpos = width/2;
ypos = height/2;
}
void draw()
{
background(102);
moveright();
moveleft();
display();
collosions();
// Update the position of the shape
// xpos = xpos + ( xspeed * xdirection );
// ypos = ypos + ( yspeed * ydirection );
// Test to see if the shape exceeds the boundaries of the screen
// If it does, reverse its direction by multiplying by -1