Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Model/View System - Course Suggestions?

Hello! I'm working on a web game. I've done lots of HTML, CSS, Javascript, in the past, but most of these things were small projects. Things like portfolios and event announcements. I also have done some work creating wordpress templates. That said, I've gotten very good at Javascript outside the DOM-manipulation space, over the past year as I've prototyped this game. Now then though I have to design the interface for this game, and I'd like it to be entirely structured with HTML. I had the idea to use data attributes and document.querySelectAll() and have since gotten menu transitions working. But I'm really stumped from a design perspective because my DOM experience is so low. I need to efficiently access tons of inputs and have the game object respond to it. For example, when creating a new game save, you select settings to generate the world. There is an options menu. In a separate system, there is player stats and inventory. All of these things need to be accessed in the same way, and output in similar ways, while in some-cases updating themselves to reflect in-game data. I think a good analogy to app design might be an excel-type app, with live data coming in somehow. I'm just very unsure as to best practices in this sort of situation.

Are there any Tracks or Courses that could help me resolve my thoughts on the situation?

1 Answer

For all the in-game data and front-end interactivity, I highly recommend going with a front-end MVC framework like AngularJS or EmberJS. They run on Javascript, so if you have an intermediate handle on Javascript, learning either of these will be pretty straight forward. I personally recommend AngularJS. The community is bigger (it's a project run by Google) and it's easier to use than other frameworks in my opinion. There's a ton of good resources to learn Angular. I found the best one to be the CodeSchool tutorial (sorry Treehouse :( you're still better).

Unfortunately Treehouse doesn't have a tutorial for any of those front-end frameworks yet. As for any data that you would need to perform CRUD on a remote dbase, you can use any back-end program you feel comfortable with. As long as you can get that data to the client, you'll be shocked how easy and powerful Angular can be once it gets its hands on it. You can even make an app work only on the front-end and use browser local storage. But that depends on the scope and particularities of your game.