This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Scoptile's profile picture

How do I check for text at a specific position.

Started by Scoptile, 21 July 2015 - 04:33 AM
Scoptile #1
Posted 21 July 2015 - 06:33 AM
I want to know how i can check for text at a given position. I really want to make a visual game where the player can move around and stop at walls, and stuff, but I need to be able to check to see if there is a certain symbol or pixel there in order to do so. I would love it if someone were to tell me how i could do this, or if there is a better way of doing it. Thanks in advance :)/>
jerimo #2
Posted 21 July 2015 - 04:52 PM
Rather than trying to make a collision map from from text in scren why not first begn by making a collision map itself?

Say we use a table, as tht makes it incredibly easy, and the movement is locked onto the grid due to technical limitations.

Within that table, we'll create more tables to set up the full map, this part I will leave to you, but keep in mind that a character will indicate a wall,leave undefined those you wish to be traversable.

Now the player will begin somewhere, and you can move them around that map much more easily, and simply check if a text character exists in the location where the player is wishing to go, if not then the player may move there.

Once that is done, you may move on to rendering the map itself, but before I go on there are a few things which you can work on, and you only asked about the collision map itself so I'll let you begin on that and attempt this part, if you need more help ask away
Edited on 21 July 2015 - 02:53 PM