Browse Source

Renamed the ISurface file. NESBank now extends ISurface.

dev-tmpl
Bryan Miller 5 years ago
parent
commit
82e88847df
2 changed files with 8 additions and 9 deletions
  1. +0
    -0
      app/js/ifaces/ISurface.js
  2. +8
    -9
      app/js/models/NESBank.js

app/js/ifaces/Surface.js → app/js/ifaces/ISurface.js View File


+ 8
- 9
app/js/models/NESBank.js View File



import Utils from "/app/js/common/Utils.js"; import Utils from "/app/js/common/Utils.js";
import ISurface from "/app/js/ifaces/ISurface.js";
import NESTile from "/app/js/models/NESTile.js"; import NESTile from "/app/js/models/NESTile.js";
import NESPalette from "/app/js/models/NESPalette.js"; import NESPalette from "/app/js/models/NESPalette.js";


return res; return res;
} }


export default class NESBank {
export default class NESBank extends ISurface{
constructor(){ constructor(){
super();
this.__LP = []; // Left Patterns (Sprites) this.__LP = []; // Left Patterns (Sprites)
this.__RP = []; // Right Patterns (Backgrounds)
this.__default_pi = [
"#080808",
"#343434",
"#a2a2a2",
"#efefef",
"#666666" // Out of bounds color.
];
this.__RP = []; // Right Patterns (Backgrounds)


for (var i=0; i < 256; i++){ for (var i=0; i < 256; i++){
this.__LP.push(new NESTile()); this.__LP.push(new NESTile());
} }
} }


get width(){return 256;}
get height(){return 128;}
get length(){return this.width * this.height;}

get coloridx(){ get coloridx(){
return new Proxy(this, { return new Proxy(this, {
get:function(obj, prop){ get:function(obj, prop){

Loading…
Cancel
Save