<commit_before><html><head>
  <script type="text/javascript" src="akihabara/gbox.js"></script>
  <script type="text/javascript" src="akihabara/iphopad.js"></script>
  <script type="text/javascript" src="akihabara/trigo.js"></script>
  <script type="text/javascript" src="akihabara/toys.js"></script>
  <script type="text/javascript" src="akihabara/help.js"></script>
  <script type="text/javascript" src="akihabara/tool.js"></script>
  <script type="text/javascript" src="akihabara/gamecycle.js"></script>
  <style>BODY { -webkit-user-select: none; margin: 0px }</style>
  <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
  <script>
var maingame;
var map;
var frameCount = 0; // New for Part 4.5

window.addEventListener('load', loadResources, false);

// This is going to be used instead of help.akihabaraInit. We wanted more screen resolution, so we changed setZoom and initScreen here.
function customInit(title) {
	var device = iphopad.getDeviceConfig();
	document.title = (title ? title: 'Akihabara');
	document.body.style.backgroundColor = '#000000';
	gbox.setScreenBorder(false);
	gbox.setZoom(1);
	gbox.setFps(25);
	gbox.initScreen(640, 480);
	gbox.addImage('_dbf', 'akihabara/debugfont.png');
	gbox.addFont({ id:'_dbf', image: '_dbf', firstletter: ' ', tileh: 5, tilew: 4, tilerow: 16, gapx: 0, gapy: 0 });
}

function loadResources() {
  // We've replaced the old help.akihabaraInit call with a custom init  
  help.akihabaraInit({
    title: '8by5',
	width: 640,
	height: 480
	});
	
  console.log("urlZoom: " + help.geturlparameter("zoom"));
  
  console.log("zoom2: " + gbox._zoom);

  gbox.addImage('font', 'font.png');
  gbox.addImage('logo', 'logo.png');
  gbox.addImage('player_sprite', 'player_sprite.png');
  gbox.addImage('map_spritesheet', 'map_pieces.png');

  gbox.addTiles({
    id:      'player_tiles',
    image:   'player_sprite',
    tileh:   16,
    tilew:   16,
    tilerow: 1,
    gapx:    0,
    gapy:    0
  });
  gbox.addTiles({
    id:      'map_pieces',
    image:   'map_spritesheet',
    tileh:   16,  // Part 4.5: changing the map tile size
    tilew:   16,  // Part 4.5: changing the map tile size
    tilerow: 1,
    gapx:    0,
    gapy:    0
  });

  gbox.addFont({ id: 'small', image: 'font', firstletter: ' ', tileh: 8, tilew: 8, tilerow: 255, gapx: 0, gapy: 0 });

  gbox.setCallback(main);
  gbox.loadAll();
};

function main() {
  gbox.setGroups(['background', 'player', 'game']);

  maingame = gamecycle.createMaingame('game', 'game');

  maingame.gameMenu = function() { return true; };
  maingame.gameIntroAnimation = function() { return true; };
  maingame.gameTitleIntroAnimation = introScreenAnimation;
  maingame.initializeGame = function() {
    // Create the 'player' (see tutorial Part 2 for a detailed explanation)
    addPlayer();

    // Create the 'map' (see tutorial Part 3 for a detailed explanation)
    addMap();
  };

  map = {
    tileset: 'map_pieces',
    map: loadMap(),
    tileIsSolid: function(obj, t) {
      return t != null;
    }
  }
  map = help.finalizeTilemap(map);

  gbox.createCanvas('map_canvas', { w: map.w, h: map.h });
  gbox.blitTilemap(gbox.getCanvasContext('map_canvas'), map);<commit_msg>Code cleanup, comments and removing debug logging<commit_after><html><head>
  <script type="text/javascript" src="akihabara/gbox.js"></script>
  <script type="text/javascript" src="akihabara/iphopad.js"></script>
  <script type="text/javascript" src="akihabara/trigo.js"></script>
  <script type="text/javascript" src="akihabara/toys.js"></script>
  <script type="text/javascript" src="akihabara/help.js"></script>
  <script type="text/javascript" src="akihabara/tool.js"></script>
  <script type="text/javascript" src="akihabara/gamecycle.js"></script>
  <style>BODY { -webkit-user-select: none; margin: 0px }</style>
  <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
  <script>
var maingame;
var map;
var frameCount = 0; // New for Part 4.5

window.addEventListener('load', loadResources, false);

function loadResources() {
  // We're passing some overrides to help.akihabaraInit to set our title, resolution, and zoom factor
  help.akihabaraInit({
    title: '8by5',
    width: 640,
    height: 480,
    zoom: 1
	});
	
  gbox.addImage('font', 'font.png');
  gbox.addImage('logo', 'logo.png');
  gbox.addImage('player_sprite', 'player_sprite.png');
  gbox.addImage('map_spritesheet', 'map_pieces.png');

  gbox.addTiles({
    id:      'player_tiles',
    image:   'player_sprite',
    tileh:   16,
    tilew:   16,
    tilerow: 1,
    gapx:    0,
    gapy:    0
  });
  gbox.addTiles({
    id:      'map_pieces',
    image:   'map_spritesheet',
    tileh:   16,  // Part 4.5: changing the map tile size
    tilew:   16,  // Part 4.5: changing the map tile size
    tilerow: 1,
    gapx:    0,
    gapy:    0
  });

  gbox.addFont({ id: 'small', image: 'font', firstletter: ' ', tileh: 8, tilew: 8, tilerow: 255, gapx: 0, gapy: 0 });

  gbox.loadAll(main);
};

function main() {
  gbox.setGroups(['background', 'player', 'game']);

  maingame = gamecycle.createMaingame('game', 'game');

  maingame.gameMenu = function() { return true; };
  maingame.gameIntroAnimation = function() { return true; };
  maingame.gameTitleIntroAnimation = introScreenAnimation;
  maingame.initializeGame = function() {
    // Create the 'player' (see tutorial Part 2 for a detailed explanation)
    addPlayer();

    // Create the 'map' (see tutorial Part 3 for a detailed explanation)
    addMap();
  };

  map = {
    tileset: 'map_pieces',
    map: loadMap(),
    tileIsSolid: function(obj, t) {
      return t != null;
    }
  }
  map = help.finalizeTilemap(map);

  gbox.createCanvas('map_canvas', { w: map.w, h: map.h });
  gbox.blitTilemap(gbox.getCanvasContext('map_canvas'), map);
{'fraction_non_alphanumeric': 0.1647940074906367, 'fraction_numerical': 0.018896833503575076, 'mean_word_length': 3.8353909465020575, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3488134', 'n_tokens_mistral': 2201, 'n_tokens_neox': 2097, 'n_words': 472}