hdot Image and File Hosting hdot - Upload File xerol.org Homepage xerol.org News/Blog Xerol's Music

hDot Image and File Hosting

Blog PHPMud Updates
Posted on 07:14:46 01/18/09 by Xerol

Share this!

Share

PHPMud is back in development and actually kind of a game now. Enemies spawn randomly and you can attack and use pre-programmed skills on them. Pretty soon they'll attack back and you'll have to earn/train skills.


One thing I had an issue with was presenting the HP, MP, and experience in a graphical manner. Originally I just had straight bars that got longer as the maximum value increased, but that became a problem after Level 5 or so. I didn't want to scale down the bars because I wanted to keep a 1 point = 1 pixel ratio, so I ended up adding a maximum length parameter to the image function and if the value was higher than that, it would start showing 'blocks' each representing one full bar.

In the 200px HP bar, which could normally show 200 HP at most without losing quality, it can now show 25 'blocks' each representing 200 HP, for a total of 5200 (after the blocks are full, there's another full bar that can be used). I still want to be able to go above 5200 HP in this game, so after those blocks are full it'll start adding long bars below that, probably so I can fit between 5 and 10 in there, multiplying the range it can display by that factor. The experience bar has an even larger range, up to 400,000 with both blocks and bars, which is going to eventually become a problem, but is good enough for now (the most experience anything in the game gives is about 40, and it takes a while to kill that, so that gives me some breathing room to figure it out).


Comments

Site Navigation
Xerol's Music

Code (c) 2006-9 Xerol

Contact: xerol@xerol.org - Put 'hdot' in subject line

Total hits since June 2006: 3204960