Class: ScriptLoader::PSDKConfig::TilemapConfig

Inherits:
Object
  • Object
show all
Defined in:
scripts/00000 PSDK_CONFIG.rb

Overview

Class describing the tilemap configuation

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTilemapConfig

Create a new TilemapConfig



280
281
282
283
284
285
286
287
288
289
290
291
# File 'scripts/00000 PSDK_CONFIG.rb', line 280

def initialize
  @tilemap_class = 'Tilemap::WithLessRubySprites_16'
  @tilemap_size_x = 22
  @tilemap_size_y = 17
  @character_tile_zoom = 0.5
  @character_sprite_zoom = 1
  @center_x = (320 - 16) * 4
  @center_y = (240 - 16) * 4
  @maplinker_offset_x = 10
  @maplinker_offset_y = 7
  @autotile_idle_frame_count = 6
end

Instance Attribute Details

#autotile_idle_frame_countInteger (readonly)

Returns number of frame an autotile wait before being refreshed.

Returns:

  • (Integer)

    number of frame an autotile wait before being refreshed



263
264
265
# File 'scripts/00000 PSDK_CONFIG.rb', line 263

def autotile_idle_frame_count
  @autotile_idle_frame_count
end

#center_xInteger (readonly)

Returns player center x value.

Returns:

  • (Integer)

    player center x value



269
270
271
# File 'scripts/00000 PSDK_CONFIG.rb', line 269

def center_x
  @center_x
end

#center_yIntger (readonly)

Returns player center y value.

Returns:

  • (Intger)

    player center y value



271
272
273
# File 'scripts/00000 PSDK_CONFIG.rb', line 271

def center_y
  @center_y
end

#character_sprite_zoomFloat (readonly)

Returns zoom of sprite character.

Returns:

  • (Float)

    zoom of sprite character



267
268
269
# File 'scripts/00000 PSDK_CONFIG.rb', line 267

def character_sprite_zoom
  @character_sprite_zoom
end

#character_tile_zoomFloat (readonly)

Returns zoom of tiles in sprite character.

Returns:

  • (Float)

    zoom of tiles in sprite character



265
266
267
# File 'scripts/00000 PSDK_CONFIG.rb', line 265

def character_tile_zoom
  @character_tile_zoom
end

#maplinker_offset_xInteger (readonly)

Returns number of tile in x to make a proper map transition with map linker.

Returns:

  • (Integer)

    number of tile in x to make a proper map transition with map linker



273
274
275
# File 'scripts/00000 PSDK_CONFIG.rb', line 273

def maplinker_offset_x
  @maplinker_offset_x
end

#maplinker_offset_yInteger (readonly)

Returns number of tile in y to make a proper map transition with map linker.

Returns:

  • (Integer)

    number of tile in y to make a proper map transition with map linker



275
276
277
# File 'scripts/00000 PSDK_CONFIG.rb', line 275

def maplinker_offset_y
  @maplinker_offset_y
end

#old_maplinkerBoolean (readonly)

Returns if the game use old maplinker method.

Returns:

  • (Boolean)

    if the game use old maplinker method



277
278
279
# File 'scripts/00000 PSDK_CONFIG.rb', line 277

def old_maplinker
  @old_maplinker
end

#tilemap_classString (readonly)

Returns full constant path of the tilemap class (from Object).

Returns:

  • (String)

    full constant path of the tilemap class (from Object)



257
258
259
# File 'scripts/00000 PSDK_CONFIG.rb', line 257

def tilemap_class
  @tilemap_class
end

#tilemap_size_xInteger (readonly)

Returns number of tile in x to properly show the tilemap.

Returns:

  • (Integer)

    number of tile in x to properly show the tilemap



259
260
261
# File 'scripts/00000 PSDK_CONFIG.rb', line 259

def tilemap_size_x
  @tilemap_size_x
end

#tilemap_size_yInteger (readonly)

Returns number of tiles in y to properly show the tilemap.

Returns:

  • (Integer)

    number of tiles in y to properly show the tilemap



261
262
263
# File 'scripts/00000 PSDK_CONFIG.rb', line 261

def tilemap_size_y
  @tilemap_size_y
end

Instance Method Details

#fix_missing_valuesBoolean

Function that fix the missing values

Returns:

  • (Boolean)

    if the files should be saved again



295
296
297
298
299
# File 'scripts/00000 PSDK_CONFIG.rb', line 295

def fix_missing_values
  need_save = false
  need_save ||= @character_sprite_zoom != (@character_sprite_zoom ||= 1)
  return ARGV.include?('debug') && need_save
end