Tag Info

Hot answers tagged

2

You can use websockets to resolve this problem. To be short, a websocket provides a way to exchange messages between several clients and your server. Principles Your websocket application could behave like this : Whenever someone opens your game web page, javascript will open a websocket connection with the server (You don't need any library on the ...


1

You will need some client Javascript and run AJAX regularly so you can run server-side PHP and check if there are any battle requests, or during combat turns to check for any player actions.


1

It looks like you might be better off with some formula: // keep the sign separate int sign = enemyLevel > playerLevel ? 1 : -1; // Calculate the xp as 1 xp per 20 level differences // Ensures that no negative xp is given int givenExp = math.min(0, 3 + (sign * math.floor(math.abs(enemyLevel - playerLevel)/20.f))); What this does is clamp each 20 levels ...


1

Neither JS nor PHP are very suitable for what you're trying to do. You can define transparency in PHP (http://www.php.net/manual/en/function.imagecolortransparent.php), but I'm not sure if you can actually read it out. Also understand that PHP is a server side language, so for any real-time interaction of on-screen elements it's not very suitable. You bets ...


1

The "best" is hard to say, you should test different technologies. I my case, I used C++ to create the server and js for client: The client comunicate by ajax with the server, but never close the socket. To allow that, it should expect steaming data. The server is made with C++, using a very fast http/https sub-set. When a client send a chat text, the ...



Only top voted, non community-wiki answers of a minimum length are eligible