
-----------------------------------
chaos
Tue Jan 04, 2011 7:09 pm

Using a text File
-----------------------------------
I am creating a two-player shooter game. I want to create the map as a text file in Notepad and use it in Turing. I also need to locate spawn points on the map. The problem is that I do not know where to start. Where do i begin?

-----------------------------------
TokenHerbz
Tue Jan 04, 2011 7:15 pm

RE:Using a text File
-----------------------------------
Things you will need to know are:

2D Arrays / File Input/Output / to start.  I would recommend going threw this link and also the F9 of your turing (maybe F10).
http://compsci.ca/v3/viewtopic.php?t=8808

The general idea i think you want to do is create a "number grid" in a text, then read that as a 2D array to draw into your program, using the different numbers for different types of tiles, including spawn points, paths, grass, etc, ..

-----------------------------------
chaos
Fri Jan 07, 2011 4:55 pm

Re: Using a text File
-----------------------------------
how would you do this using pixel graphics?

-----------------------------------
Insectoid
Fri Jan 07, 2011 8:45 pm

RE:Using a text File
-----------------------------------
You could use modulus to estimate where the character is on the ascii map.

-----------------------------------
TokenHerbz
Fri Jan 07, 2011 8:45 pm

RE:Using a text File
-----------------------------------
you would just import the picture and use it to draw/move.  It's also in the walkthrew and F10 in turing if you take a look..

Give it a try and i'll assist. (post your efforts)

-----------------------------------
chaos
Fri Jan 07, 2011 9:54 pm

Re: Using a text File
-----------------------------------
do i create the map in Paint or some other program? When i create the map, in what format should i save it as (jpeg, bitmap,  gif) ?

-----------------------------------
TokenHerbz
Fri Jan 07, 2011 11:12 pm

RE:Using a text File
-----------------------------------
Well with turing i'd use bitmap even tho its like a large file, less problems arrise.

Iv'e also used paint to create images both large and small and used them with sucess.

-----------------------------------
chaos
Mon Jan 10, 2011 8:09 pm

Re: Using a text File
-----------------------------------
I tried to make a map using notepad. I opened it up in Turing and the output window showed some of my map as random characters. Why does this happen?

-----------------------------------
Tony
Mon Jan 10, 2011 8:32 pm

RE:Using a text File
-----------------------------------
Perhaps because you are using tabs on line 15 instead of spaces like everywhere else?

-----------------------------------
chaos
Wed Jan 12, 2011 6:22 pm

Re: Using a text File
-----------------------------------
Thanks Tony. I fixed that mistake and did some work with my problem. I can get my map drawn on the output window. The problem is that the window doesn't stay in one place. It moves down to draw more of the map which isn't there. How do I fix this?

-----------------------------------
chaos
Wed Jan 12, 2011 6:23 pm

Re: Using a text File
-----------------------------------
Here is the map:

-----------------------------------
Tony
Wed Jan 12, 2011 6:54 pm

RE:Using a text File
-----------------------------------
If you are putting too much text, the window will scroll. You can do a number of things:
- think of some checks to make sure that you are not printing too much text
- use [tdoc]locate[/tdoc] to move the cursor back up
- work with graphics instead of text

-----------------------------------
chaos
Wed Jan 12, 2011 7:39 pm

Re: Using a text File
-----------------------------------
I tried what u said and it helped. So how would i go about drawing the map and enbaling player movement while the map is still drawn?

-----------------------------------
Tony
Wed Jan 12, 2011 7:44 pm

RE:Using a text File
-----------------------------------
You'd have to draw everything on the screen, every time something changes. So once the player moves, you'd have to clear the screen, draw the map again, and then the player at a new location on top of the map.
