mirror of
https://github.com/SleepingInsomniac/pixelfaucet
synced 2025-01-23 07:27:17 +01:00
26 lines
606 B
Crystal
26 lines
606 B
Crystal
require "../src/game"
|
|
|
|
mapping : String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!?().,/\\[]{}$#+-“”‘’'\"@=><_"
|
|
tiles = PF::Sprite.load_tiles("assets/pf-font.png", 7, 8)
|
|
|
|
puts "CHARS = {"
|
|
tiles.each_with_index do |tile, i|
|
|
if letter = mapping[i]?
|
|
if ['\\', '\''].includes? letter
|
|
print " '\\#{letter}' => "
|
|
else
|
|
print " '#{letter}' => "
|
|
end
|
|
|
|
n = 0u64
|
|
mask = 1_u64 << (7 * 8)
|
|
|
|
tile.pixels.each do |pixel|
|
|
n |= mask if pixel >> 8 <= 127
|
|
mask >>= 1
|
|
end
|
|
|
|
puts "0x#{n.to_s(16).rjust(16, '0')}_u64,"
|
|
end
|
|
end
|
|
puts "}"
|