Type FileStream not found (Closed)

Monkey Forums/Monkey Beginners/Type FileStream not found (Closed)

BradMangham(Posted 2016) [#1]
Hi,

I'm making a maze runner game using a tutorial given to me in class. However, I am having a problem with the code.

[CODE]
Import mojo
Import brl
Global Game:Game_app
Const Wall = 1
Const Grass = 2

Function Main()

Game = New Game_app

End

Class Game_app Extends App

Field menu:Image
Global GameState:String = "MENU"
Field maze:Level

Method OnCreate()

SetUpdateRate 60
menu = LoadImage("menu.png")
maze = New Level
maze.load()

End

Method OnUpdate()

Select GameState
Case "MENU"
If KeyHit(KEY_SPACE) Then GameState="INITIALISE"
Case "INITIALISE"
GameState = "PLAYING"
If KeyHit(KEY_ESCAPE) Then GameState="MENU"
End
End

Method OnRender()

Select GameState
Case "MENU"
DrawImage menu, 0,0
Case "PLAYING"
Cls 0,0,0
maze.draw
End
End
End

Class Level

Field tiles:String[21][]
Field tileset:Image

Method New()

tileset = LoadImage ("tiles.png",32,32,3)
For Local i:Int = 0 To 20
tiles[i] = New String[16]
Next
End

Method load()

Local level_file:FileStream
Local level_data:String
Local data_item:String[]

level_file = FileStream.open("MonkeyXFree84f/Monkey_X_Projects/Maze_Runner/maze.data/maze.txt","r")
level_data = level_file.ReadString()
level_file.close

data_item = level_data.Split("~n")
For Local y:Int = 0 To 14
For Local x:Int = 0 To 19
tiles[x][y]=Int(data_item[y][x..x+1])
Next
Next
End

Method draw()

Local tile:String
For Local y:Int = 0 To 14
For Local x:Int = 0 To 19
tile = tiles[x][y]
If tile = Wall Then DrawImage tileset, x*32, y*32, Wall
If tile = Grass Then DrawImage tileset, x*32, y*32, Grass
Next
Next
End
End
[/CODE]

On the line, [CODE] Local level_file:FileStream [/CODE] in the load method within the Level class, I am getting an error which reads "Type 'FileStream' not found".

Any suggestions? As my teacher has no clue.

Thanks,

Brad


BradMangham(Posted 2016) [#2]
Problem solved, there was an issue with permissions on the school system that wasn't letting me run it as a desktop game, which it needed to be.