Jump to content
MakeWebGames

a_bertrand

Members
  • Posts

    3,655
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by a_bertrand

  1. Honestly I believe that developing for XBOX is a lot restrictive and you would have a bigger market share to develop for windows instead. But that's my opinion of non-console owner... so maybe I'm biased here.
  2. Well if it is your first programing language, then it certainly cost you a lot of time to understand the concepts (variables, loops, arrays, functions etc...) if not then it's just matter of learn the keywords linked to the language basically. So if this is your first language, you should maybe try with VERY basic things, and try to understand the concepts I mentioned before as well as others... But you will find all sorts of info on the web. To learn, just reading is in fact not enough, you must try, and retry until you grab the concept. For that, pick very simple goals and try to implement them. A goal like "I want a game" is way too big to start with.
  3. For VPS I use those: https://www.tektonic.net/virtual-servers.html Starts at less than 15$ per month (you must choose the smallest VPS to see it) and never had any issue (running since 2 years).
  4. And what is your question exactly?
  5. Well doing it in PHP is certainly not hard:   $rowid=0; while(!$db->EOF) // Or whatever class you use { $row=$db->read(); if($rowid%2 == 0) echo "<TR>"; else echo "<TR BGCOLOR=#FFA0A0>"; // A nice pink is needed here otherwise it doesn't work echo "<TD>{$row[0]}</TD>"; echo "</TR>"; $rowid++; } $db->Close();
  6. Use the count(*) instead of selecting all and then checking how many rows it returns. It will be both faster for the database as well as for PHP and will be at the end lighter for your server: Bad: $total = $db->query("SELECT `bank_employee` FROM `bankemployees` WHERE (`bank_id`=".abs((int) $rar['bid']).")"); $amount = $db->num_rows($total);   Good: $total= $db->query("SELECT count(`bank_employee`) FROM `bankemployees` WHERE (`bank_id`=".abs((int) $rar['bid']).")");   Beside that I'm glad to be helpful ;)
  7. Well, that why you took the right road to ask before having your product finished ;) Keep in mind that my design, even if more scary due to its more table design, is a lot more powerful and allows you to create reports of all sorts. And this is exactly where a DB is useful, not just to store data (otherwise you could as well "serialize" your arrays on files). Now I understand some queries can be more difficult to write, but I'm willing to help (join the IRC chat and hope I'm there or drop a line here).
  8. Well I see already the problem here: "`bankemployees` varchar(255) NOT NULL" Means when your array list is over 255... you will not be able to store more people inside. What about large games with a huge number of people inside? Ok let's take ID of players are 5 char each (means max number is 99999 so under 100K registrations which is small) means you can have max 42 employees per bank (as you need to count 6 char (5+1) per player). Also, try to make a query which returns the more powerful bank (by checking how much money each employees have) and you start to have loops... which is slow. So overall I would go for my own design but of course you are free to do whatever you want ;)
  9. Let's create some tables: [mysql] CREATE TABLE EMPLOYEE( ID INTEGER PRIMARY KEY AUTO_INCREMENT, FIRST_NAME VARCHAR(80), LAST_NAME VARCHAR(80)); CREATE TABLE BANK( ID INTEGER PRIMARY KEY AUTO_INCREMENT, NAME VARCHAR(80)); CREATE TABLE EMPLOYEE_ROLE( ID INTEGER PRIMARY KEY, NAME VARCHAR(80)); INSERT INTO EMPLOYEE_ROLE(ID,NAME) VALUES (1,'loan officers'), (2,'collectors'), (3,'ceo'); CREATE TABLE BANK_EMPLOYEES( BANK_ID INTEGER NOT NULL, EMPLOYEE_ID INTEGER NOT NULL, ROLE_ID INTEGER NOT NULL, PRIMARY KEY(BANK_ID,EMPLOYEE_ID)); [/mysql] Now let's add some data to play with: [mysql] INSERT INTO EMPLOYEE(FIRST_NAME,LAST_NAME) VALUES ('A','Toto'), ('B','Tata'), ('C','Titi'), ('D','Rolf'); INSERT INTO BANK(NAME) VALUES ('Bank A'), ('Bank B'); INSERT INTO BANK_EMPLOYEES(BANK_ID,EMPLOYEE_ID,ROLE_ID) VALUES (1,1,1), (1,2,2), (2,3,1); [/mysql] Now that we have some data, we can start querying: Retreive all employees of 'Bank A' [mysql] SELECT EMPLOYEE.* FROM EMPLOYEE,BANK_EMPLOYEES WHERE BANK_EMPLOYEES.EMPLOYEE_ID=EMPLOYEE.ID AND BANK_EMPLOYEES.BANK_ID IN (SELECT ID FROM BANK WHERE NAME='Bank A') [/mysql] Or let's count them: [mysql] SELECT COUNT(*) FROM EMPLOYEE,BANK_EMPLOYEES WHERE BANK_EMPLOYEES.EMPLOYEE_ID=EMPLOYEE.ID AND BANK_EMPLOYEES.BANK_ID IN (SELECT ID FROM BANK WHERE NAME='Bank A') [/mysql] Or let's count all the employees for all banks: [mysql] SELECT COUNT(*),BANK.NAME FROM BANK_EMPLOYEES,BANK WHERE BANK.ID=BANK_EMPLOYEES.BANK_ID GROUP BY BANK.ID [/mysql] Etc... if you need more queries let me know ;)
  10. Well don't know your DB design... Anyhow having rows containing multiple values is not very smart (if this is the design you use currently) as you cannot do much without going though some code, where the DB could do all the work for you. For example if you need to retrieve multiple ID => SELECT * FROM XYZ WHERE ID IN(1,2,3)
  11. Why not let the DB make it for you with something like [mysql] SELECT COUNT(*) FROM MyTABLE WHERE COMPANY=X [/mysql]
  12. SirChick: for sure not, browsers will not any time soon drop support for old tags as they would not be able to render old content and that would be a huge problem.
  13. I don't see how you can make your game unique (which is for me mandatory for a successful game) as you can't code anything. Why would the players come and play your game more than another one? What will your game offer that others don't? Sorry really here I find it as lame as possible and if you consider that game development then I think I'm completely off track myself with my own projects.
  14. sprintf is a way to somehow secure yourself against SQL Injections. However it doesn't fix all and therefore it is not the solution I would recommend. I would myself use mysql_real_escape_string around any string and a ($var+0) against any number. With that you should be fine against SQL injections (again that's only part of the hacking issues your scripts can have).
  15. I do like the site and the professional look... however the hosting prices seems expensive to me.
  16. Well a good example of something I will not follow for the moment are the following "deprecated" tags: B, CENTER for bold why should I write <span style='text-weight: bold'></span> instead of ? Not only it take more characters, it is slower (due to that) on the net, but also more prone to errors while typing. Center is even worse as you don't have a full equivalent with CSS as <CENTER> centers about anything where you need to set what you want to center with CSS (text, div or whatever else). Other things simply disappeared like the TARGET attribute in 4.1 odd enough this is something I use... so what can you do? JS? well sorry but again it is way not smart. Another example of pitfall is the XHTML, on Firefox if you use XHTML you will have a different rendering than an old style HTML. So be aware you may end up with different looks just if you start your HTML document differently. Finally, as I always said, I doubt browsers will ditch support for the old tags (even if deprecated) as it would mean that all the old HTML documents (and there is tons of them) will not be supported anymore. Who would like to have such browser where you can't see old documents correctly? Nobody, and therefore even if the new "standards" don't have support for the old tags browsers will be forced to keep them.
  17. We had some discussions today in the chat, and we came to the point that some people love to validate their HTML pages and some find it useless (I'm in the second group). You may find all kind of positions on the web like http://www.codinghorror.com/blog/2009/03/html-validation-does-it-matter.html. However what's clear is that: - Your site looks good - It looks more or less the same on all major browser - It doesn't take ages to load. After that, honestly, who cares if you use XHTML, HTML 4 or whatever else? It must work, and it must attract people. If your site is valid or not, it is your own affair not the one of the people coming to use it. Also, don't expect an HTML Valid site will look the same on all browsers as it will for sure not be the case. Maybe small differences, maybe nearly none, or even completely different but for sure it will not be the same. Why? Because the standards don't really define at the pixel level how it should look like ;)
  18. There is a lot of ways to do so: http://php.net/manual/en/book.zip.php http://sourceforge.net/projects/phpziplib/ or you can maybe call a shell unzip to do so:   exec("unzip -l /tmp/xyz.zip",$result);
  19. a_bertrand

    GD question

    By doing so: RewriteEngine on RewriteRule ^/users/([0-9a-zA-Z])\.png$ /images/?id=$1   You say that only the urls with /users/XYZ.png will be converted what doesn't start with /users/ will not (it is just an example). I you just say whatever ends by .png will have way too many matches and could be counter productive.
  20. a_bertrand

    GD question

    RewriteRule ([0-9a-zA-Z])\.png$ /images/?id=$1 Will rewrite ALL the .png files to that... are you sure that's what you want?
  21. a_bertrand

    GD question

    so either you use a mod rewrite for something like /myimg/img.png which would be then pointing at myphp.php?image=img.png or you could use a the PATH_INFO to have an url like myphp.php/img.png Is it what you are looking for?
  22. a_bertrand

    GD question

    So you don't want the filename in the argument but some... hash? well you can't directly you must store the full path in a db with as key an hash (md5 or whatever) and then you can use that to find the true path.
  23. Learn is is useful, but it would not be my first choice. Pick Java or C# => easier and you will get anyhow any kind of professional work with those.
  24. Ok created a demo user: Username: demo Password: demo - The map is WAY too slow to load specially if it needs to reload on each step. Sorry but you MUST change the way it is done before even expecting to have players. - I don't get the story, I have no clues what I have to do beside moving => annoying - The left menu doesn't work doesn't work well on Firefox (last link is at least nearly invisible) - Overall it is quiet ugly... not very inviting. How to improve: - Have some introduction, explain a bit the story, explain what you can do - Have a JS based map (ajax or not) - Change the art to be a bit more interesting.
  25. Dell, Acer, Asus, Toshiba are ok even if Acer tends to be slow machines. For 2-5 min video editing for the web a laptop will be fine. Then you need to think about the screen, weight and battery life: - Bigger screen == less battery == more weight - More battery life == smaller screen
×
×
  • Create New...