I finally worked out how to display a table with individual cell IDs representing the coordinates for my current project (It’s called Kingdom of Might – cliché, but then again it’s just a project name for now). And now it is just a simple matter of displaying the content in each individual cell using an array like
$content[$id]. Took a while to figure out the math and the centre cell positioning, but now I got it worked out.
(There will be a
sight attribute to the game, which decides how many grids you can actually see.)
Stage 1: Labeling each individual cell with an ID. Note that the first cell is blank due to it having a value of
Stage 2: Determining the ID of the center cell.
I use this formula:
c = [s(1+2s)] + s
where c is the centre cell id and s is the sight attribute from the database
Stage 3: Putting everything together.
And the code that made it work:
I was feeling a little bored and so I challenged myself to
fix get Project Extension running (in some functional sense at least), and I surprised myself at how quickly I managed to patch together some hacks to get it online again.
As you can see, it is not fully functional – the character stats for some reason don’t show – nor do I have the intention to fix it (at this point in time). However, what I really wanted to do was actually to look for some form of inspiration for a new project, something more complex than an online authentication system or a contact form. What I have come up with is a coordinates based online RPG. Even though I realized that this genre has sort of been done to death, the intent of this project is nothing more than a practical exercise in planning and coding an interactive site.
To be updated. (:
I’ve decided that instead of wasting my life away, I shall do something productive before I enlist. I have been thinking of creating a new web application, but gave up on that idea eventually since a) I couldn’t come up with a decent idea and b) any web application these days requires great familiarity with AJAX, which sadly I lack. I have also been considering rewriting Project Extension, but that would be quite a large scale project. So in the end I have decided to update my Integrated Contact Form script, as previously promised.
However, I know how long it usually takes before I push an update out of the door (due to my own procrastination and lack of focus) and so I have decided to change the way I do things this time around. Regardless of how many new features I manage to implement, I would get a build of ICF online on the 28th Jan, which is a week away. This gives me 6 days to code (ok, less than that, since I wouldn’t be at home all week) and 1 day to clean up and prepare the code for release. In theory, I would be more productive and you all would get more frequent updates.
Below is a updated features list for the upcoming build in terms of priority (most of these features below would be available as options). Note that I have decided to remove the Administration panel since I don’t think many of you guys actually use that feature, but I would make it available as an add-on sometime later.
- CAPTCHA check
- Prevent too many emails from being sent within a short period
- Email validation. If turned on, the visitor would be sent an email, where they would have to click a confirm link before their email is sent.
- Greater flexibility with themes and language file (even though the themes are almost ready)
- File restructuring
So keep watching this space or subscribe to my RSS feeds (link to feed dedicated to ICF updates) or follow me on Twitter (@wuxiaotian)
There is a bug in the encoded version of the script where
register.php would result in a PHP Fatal Error – something I didn’t catch since I was doing my testing with the original unencoded code. This update would fix the bug.
[Download not found]
I have finally found sometime to update the code for Advanced Login System, bringing the version build up to 20091220. I have also removed the password salt (since I figured they don’t really do much), so there is only 1 standard version and you should be able to upgrade from any previous version of ALS starting from v0.02B.
You can download it here.
As usual, source code is encoded but available for purchase at USD$20. Contact me for more information or to report bugs in the script.
UPDATE: An updated version is available for download here.