Convert String to Grid

M

Matthew D.

Hey, I am kinda new to ruby... and programing...
Anyway, I had an idea of making an ascii game with ruby for the console.
I found a way to make (and break :p) grids, but can't figure out how to
convert a map file into a grid. The map file has a key included and I
think I can figure out how to parse that but I cannot for the life of me
how to put the map into a grid, for character movement. Anyone know how?
 
7

7stud --

Matthew D. wrote in post #996640:
Hey, I am kinda new to ruby... and programing...
Anyway, I had an idea of making an ascii game with ruby for the console.
I found a way to make (and break :p) grids, but can't figure out how to
convert a map file into a grid. The map file has a key included and I
think I can figure out how to parse that but I cannot for the life of me
how to put the map into a grid, for character movement. Anyone know how?

I'm not new to ruby, nor to programming. I have no idea what a 'grid'
is, nor what a 'map file' is. Are those universal terms that everyone
under the age of 15 understands?
 
S

Stu

He's referring to a tile map so he can make a tile map
editor/converter with ruby. Think like glade but for games.

Think Lode Runner from the apple ][ days =3D)
Or even mario.

Here is an example of a graphical one:
http://images.mapeditor.org/tiled-qt-screenshot-2.png

The idea is once the map is created it can be saved (i.e. multi
dimensional array)

when it's read back in the it builds the grid back on the screen and
act as a complete surface but with the memory footprint of a couple
small sized sprites.

op look into ncurses for your game. If you need help parsing the map
you will need to show us the map file. Just a simple screen example
not the whole file. Also include this "key" you refer to. Seeing you
don't have control over the file where did it come from? What other
program/language created it? Is this homework?

~
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top