Browser Game Questions

Need help with an engine or coding not on the list? Need help with a game or the website and forums here? Direct all questions here.
Post Reply
ZeroComp
Posts: 648
Joined: Thu Oct 29, 2009 8:48 pm

Browser Game Questions

Post 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..........
Coding-PHP, Javascript, C++, HTML, mySQL
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
User avatar
Chris
Posts: 1581
Joined: Wed Sep 30, 2009 7:22 pm

Re: Browser Game Questions

Post 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.
Fighting for peace is declaring war on war. If you want peace be peaceful.
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: Browser Game Questions

Post 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 :)
User avatar
Chris
Posts: 1581
Joined: Wed Sep 30, 2009 7:22 pm

Re: Browser Game Questions

Post 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");
Fighting for peace is declaring war on war. If you want peace be peaceful.
jpoisson
Posts: 245
Joined: Sun Aug 02, 2009 5:12 pm

Re: Browser Game Questions

Post 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());
?>
Laguages:
PHP, MYSQL, (X)HTML, HTML5, JQuery, CSS 3.0,
C, C#, C++, Python, Pascal, Perl, Ruby, Turing

Software:
Adobe MC CS4, Visual Studio 2008, Notepad++,
NetBeans IDE, WAMPSERVER

Browsers:
Internet Explorer, Firefox, Opera, Safari, Chrome
(Always have latest patches for browsers.)

Free time:
...
deluxxmanx
Posts: 88
Joined: Thu Nov 26, 2009 10:22 pm

Re: Browser Game Questions

Post 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! ;)
Image
I am a PS CS4 artist. Signature above made by me.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Browser Game Questions

Post 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.
The indelible lord of tl;dr
ZeroComp
Posts: 648
Joined: Thu Oct 29, 2009 8:48 pm

Re: Browser Game Questions

Post 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
Coding-PHP, Javascript, C++, HTML, mySQL
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Browser Game Questions

Post 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.
The indelible lord of tl;dr
Post Reply

Return to “Advanced Help and Support”