Page 1 of 1

Browser Game Questions

Posted: Sun Jan 03, 2010 8:27 pm
by ZeroComp
1.The inn won't heal spoints I've tryed to edit the code on my own but it just won't work
2.I want to change the backround to black and I know how but I need to change the text color and fonts to ALL the text how do you do that
3.I want to have a creature kill leaderboard and tournaments how do I do this?
4.I want to have a player message system yet I have absolutely no idea how to do this.

I know I may seem whiney and helpless but I just want to get things done..........

Re: Browser Game Questions

Posted: Mon Jan 04, 2010 10:25 pm
by Chris
1. Turn your PHP errors on.
2. after each mysql_query function add, or die(mysql_error());

eg,

Code: Select all

<?php
mysql_query("SELECT * FROM `gay`") or die(mysql_error());
?>
3. Should you stumble accross an error you're not sure how to fix. Google knows many great things. Give it a try: http://google.com/
4. Look over your PHP, think to yourself if the scturcture is logical.

Trial and error is the best way of learning. Don't ask too be spoon fed too much or you will never get the hang of PHP.

Re: Browser Game Questions

Posted: Mon Jan 04, 2010 11:37 pm
by OldRod
You can also change "die(mysql_error())" to something more meaningful. I usually put in some text telling what I'm trying to do and what file is causing the problem - helps track down problems easier than the generic mysql messages sometimes.

Up to you though :)

Re: Browser Game Questions

Posted: Tue Jan 05, 2010 9:10 am
by Chris
Yeah, but generally you want to diagnose any errors that might be causing your problem. That's why I told you that. Of course you can put your own text in:

die("Some shit");

Re: Browser Game Questions

Posted: Tue Jan 12, 2010 7:01 pm
by jpoisson
but I only suggest putting in your own text as reference to code where as if an error arises you know where then you can use mysql_error().

Code: Select all

<?php
    mysql_query("SELECT * FROM `gay`") or die('Error in selecting all from gay table');
?>
if an error arises then it will show "Error in selecting all from gay table'" then you reference back to that then place in the mysql_error()

Code: Select all

<?php
     mysql_query("SELECT * FROM `gay`") or die(mysql_query());
?>

Re: Browser Game Questions

Posted: Wed Jan 13, 2010 8:14 pm
by deluxxmanx
About the font as much as I understood what you need, you meant to change the background to black, & let's say make all or a part of the fonts white? I use this then: <font color=white> Text </font color>

So let's say for example:

Code: Select all

<?php
start_session ()
include "globals.php"
echo "<font color=red>Welcome to the game!</color>"
?>
I don't know if you knew this already, but if you don't this might help you mate.
<b> TexT </b> - makes text bold.
<u> TexT </u> - underlines the text.
<h3> TexT </h3> - set the fonts size. (number 3 can be anything [the smaller the number the bigger the font])
<font color=white> TexT </font color>


Hope this helps at least a tiny bit mate, good luck on your project! ;)

Re: Browser Game Questions

Posted: Wed Jan 13, 2010 10:33 pm
by Jackolantern
You should not be using the font tags in HTML, as they are deprecated. Instead, CSS should be used. Eventually, those deprecated tags are going to be removed, which means that they will not render correctly when browsers are updated to the standard. Best to make it future-compatible now, rather than have to change hundreds of pages later.

Here is a great CSS primer.

Re: Browser Game Questions

Posted: Wed Jan 13, 2010 10:43 pm
by ZeroComp
Great thanks! That's where I learned HTML a bit of of JS and some PHP but never really dabbed into to CSS that much. I will need to study up on that a bit

Re: Browser Game Questions

Posted: Wed Jan 13, 2010 10:55 pm
by Jackolantern
ZeroComp wrote:Great thanks! That's where I learned HTML a bit of of JS and some PHP but never really dabbed into to CSS that much. I will need to study up on that a bit
Just don't over complicate yourself, which is really easy to do while learning CSS. It can get extraordinarily complicated when you are making artistic web pages, but just knowing how to slap some font attributes and basic formatting through CSS is very helpful.