PHP and HTML for games?

Miscellaneous Forums/General Discussion/PHP and HTML for games?

haha..

next week? a mmo would take a lot longer than a week... not for the engine, for the content. I could prolly have an MMO engine built in a month or so. Anything you'd like to see included in that? or just a turn based MMO with shops, and tactical battlefields all across the world? the issue is conversation, I haven't ever done a chat system, specially one that shows new msgs without a reloading of the page... if someone showed me how that worked, and it works on any broswer, I could do it... otherwise, I'd stick with a see what was said when you post or when you reload it.

I don't really want to make an MMO yet tho. I want to test the concepts on a single player game first, then move into the whole multiplayer mmo thing.. not cause it is harder, because it really isn't, but because it is longer.

I'm going to hold all the data in databases, such as Sprites, Tiles, Equipment Spells Items and so on.. and lets take items for example, they will have a graphic assigned to them when they are made or edited, so they will chose from the list of Sprites, and it will all work together to form the content for the game.

The engine will read that it needs lets say a Potion from the items table then the Potion says it needs the Potion_003 from the sprites table, it will display the info in the inventory, and lets say the player clicks Use next to potion, then it will look and see the party members of the PC's team, he picks someone to use it on, then it looks up what Potion does and so on.

all the maps and npcs and everything will be held like this, so it will be very natural when coding the engine. I might make it more OO or maybe not. but either way there will be things like item_sprite_name(item's name); which returns that item's sprite's name. which can then be used in sprite_url(sprite's name); to return the URL for use in an <img> tag.

so the code might end up looking like
echo "<img src = "";
echo sprite_url(item_sprite_name("Potion"));
echo "">";


this would be, obviously, for the Item list in an inventory screen, which wouldn't use the table scheme I described before, but sprite_url(); would be used in that too, to call any of the sprite's urls based on their name as given by anything else... Like maybe.... npc_sprite_name(Bob,left); which returns Bob's left facing sprite's name. so now.

echo "<img src = "";
echo sprite_url(npc_sprite_name("Bob","left"));
echo "">";


That will show bob facing left or maybr current direction of the NPC's facing will be stored in the database, so it will automatically be changed when bob decided to move left in the last turn.