Skip to content
Linus edited this page Feb 9, 2015 · 2 revisions

MODEL

Rails backend

  • NO USER TABLE! (no logins! all game assets and server assets (high score) are handled manually through rails console!)

  • GameDeck: (1) deck of enemy cards, (2) deck of player cards

    • it might be easy to just do 'GameDeck', and 'Deck', and then have GameDeck = Deck(enemycards) + Deck(playercards)
  • Card

    • all player cards have a COST associated with it
    • some cards have a 'INIT' flag, where if set to true, means that that card can be used to initialize the player's starting hand
      • player hand initialization can be further refined, but basically we have to have a set of 'basic' cards that must be used, b/c the enemies are 'basic' at first --- we have to avoid OP-ing the player's initial hand
    • enemy cards obviously do not have COST
  • Highscore

    • it's a flat list of 100 Score types
  • Score

    • Scores are a numeric value that's kept as part of GAMESTATE
    • it should be able to be saved when a player dies, and their score is >= to any of the existing "top 100" high scores

Seeding

  • load in all game assets (pictures, cards, etc.) from an external source
    • most likely this will be a YAML file or something similar --- maybe even a raw .rb ruby file if we don't want to bother with parsing

Ember

  • We need to import the mongo Deck/Card stuff into JS
    • 'gon' gem from rails?
    • what about 'ember-rails' --- does it have bindings to mongo so we can call a Mongo route directly within JS?
      • I've seen this kind of (call rails route and extract JSON-serialized model) JS code in other projects, albeit not using Ember or Mongo
  • BOTTOM LINE: Ember needs to get all GAMEDECK info as a SINGLE JSON OBJECT to work with upon game initialization
    • hmm, but if we do it all in one go, user is going to have to wait while all the data is transferred to ember
    • OPTIMIZATION: it might make sense to have the ember app query the server for only the cards that it needs

VIEW

Rails

  • dyla2/config/routes.rb should have routes for the gamedeck, deck, card resources (JSON readonly GET requests), because our Ember will call the server for decks/cards

Ember

  • Single page app (SPA) using Emberjs
  • Emberjs comes with route handling functions/framework; see http://emberjs.com/guides/routing/ for a reference, but the TODO app tutorial is already pretty solid on this

design/layout

  • basically copy over much of the layout design of dyla1
  • but we probably don't need the GameLog dead center
  • we should probably display some info regarding enemy size (a pile of decks, one is set to 'active'?)
    • something more than just 'Enemy threat level 1' in dyla1
  • it would be cool to have a 'map of the galaxy' or something, and we travel between galaxies after each fight/battle/campaign is won

CONTROLLER

Ember

  • looking at the TODO app, basically we need controllers for every UI 'box' element in the page

  • so if we look at dyla1, we need:

    • enemy(card/deck/???) controller
      • maybe some enemy cards are 'boss' cards that spawn additional enemies --- like Sentinels of the Universe
    • player hand controller
    • game log controller
    • shop controller
    • game state controller (read-only -- displays the current game stats like player HP, TP, VP, turns, deck size, discard size, etc)
  • there will probably be interactions between all of these controllers to actually play the game

Clone this wiki locally