Community Page
- buildingbrowsergames.com Jump to website »
-
Subscribe -
Community
-
Top Commenters
-
Popular Threads
-
Recent Comments
- I get errors like this: "Notice: Use of undefined constant attacker - assumed 'attacker' in /Users/Niels/Sites/bg/smarty/bg/forest.php on line 53" Caused by the arrays:...
- I read this tutorial and it help me get in the mindset I needed to be in to start my first big project. Nice job on the tut and I look forward to reading more from you. If you want to check out my...
- You're missing the string formatting that puts arguments into your SQL statement - add that, and you should be good to go.
- "SELECT value FROM user_stats WHERE stat_id = (SELECT id FROM stats WHERE display_name = <foo> OR short_name = <foo>) AND user_id = <bar>" i have inserted this into sql...
- The source is definitely all still there - take a look at http://code.google.com/p/building-browsergames-tutorial/, and click on the 'Source' tab.
Jump to original thread »
One important but often neglected part of building a browsergame is planning it - what you will be building, and how you will be building it.
So far, we’ve built a login and registration system for a browsergame - but not much else. In order to plan a little more out for our game%2 ... Continue reading »
So far, we’ve built a login and registration system for a browsergame - but not much else. In order to plan a little more out for our game%2 ... Continue reading »
5 months ago
5 months ago
If u have a link to something u can mail me.
Greetings
5 months ago
a templating system lets you keep design and code separate from each other.
There is no Smarty-less version of the tutorials.
4 months ago
Keeping presentation separate from business logic is the foundation for good development, however, PHP is already a templating system. Using an abstraction on top of something that already does a good job at abstracting code is not a good idea.
Many languages do not have the luxury of combining code with HTML, which forces them to keep it separate and building the abstractions into their business logic. This creates complexities that are not needed. The primary focus should be building a solution as quickly, but as professional as possible.
Smarty goes against this by forcing both the designers and programmers to learn the language of Smarty. You then have to hope that the next project also uses Smarty and not some other convoluted custom system. I've seen many custom templating systems and I have to say that not many projects use Smarty.
Another issue from the developer's point-of-view is extensibility, which is difficult for Smarty, because while it has its own API for it, not every custom templating system will. The API for Smarty (when I last checked) was not as simple as it should be.
When I write a template system for a project, I think of WordPress, because they do it as easy as possible for both developers and designers ("Just plug this code in to your code and it just works"... "In most cases."). As opposed to spending two or three weeks learning how to use Smarty and other two or three weeks trying to learn how to extend Smarty with custom tags.
I can do everything Smarty does using just (X)HTML and PHP, which Smarty abstracts from the developer and designer. If you ask me, PHP is far easier to use than the syntax Smarty forces you to use.
4 months ago
business logic and presentation code(and even seems to encourage you to),
I'm wary of writing code that does that. Frequently for my own projects they
have begun with a sole developer(me), and then as they have gone on the team
has grown - all too often, a designer who knows nothing of PHP and has no
desire to learn it is the one who will be doing the final design for the
game. In those situations, being able to give them a list of the variables
available to them in the template and the Smarty documentation has proven
extremely useful to allow me to keep focusing on features, while someone
else focuses on making things look nice.
While embedding PHP directly into your files is an option, it is a bit of a
messy one - and it makes it far too easy for someone who doesn't know enough
PHP to have a firm grasp on what they're doing to break something that they
shouldn't.
To be clear, I am certainly not saying that Smarty is the *best* or *only* way to develop. I'm simply saying that your code *should* be abstracted from your presentation, and using a templating engine like Smarty or something else is a better way of doing that(in my opinion) than relying on someone copying and pasting code without understanding what it does.