Hi Everyone!
I'm still trying to figure out how I'll ultimately structure my game for good performance and ease of read, but I haven't found the ultimate way of doing this but I have had some ideas after playing around with Types and Functions.
If I understand correctly, Types can be used for almsot everything that needs to be redone more then once. The only downside is the fact that they depends on inside values to function so the difference between two of the same type is limited. If that makes any sense. The way I see it, is:
Let's say you have Type TButton... and you have a TRoom and you wana place Buttons into a room it can be done(via method and functions) but it will be the same for all the rooms you may be able to change the values of those button inside the TRoom type but not how many you have of them.
So basicly Types is basicly duplicable storage space with internal behavior (mewthod and functions), no?
So I though then I have no other way to make it so every room is different then to make an outside Functions to contain all the information of all the different room as.. follow:
This is the simple structure I came out with, it's jsut a global idea of how I'd do it:
What do you guys think? Any better ideas? Am I way off? Or over complicating stuff.. like I usually do lol?
I'm still trying to figure out how I'll ultimately structure my game for good performance and ease of read, but I haven't found the ultimate way of doing this but I have had some ideas after playing around with Types and Functions.
If I understand correctly, Types can be used for almsot everything that needs to be redone more then once. The only downside is the fact that they depends on inside values to function so the difference between two of the same type is limited. If that makes any sense. The way I see it, is:
Let's say you have Type TButton... and you have a TRoom and you wana place Buttons into a room it can be done(via method and functions) but it will be the same for all the rooms you may be able to change the values of those button inside the TRoom type but not how many you have of them.
So basicly Types is basicly duplicable storage space with internal behavior (mewthod and functions), no?
So I though then I have no other way to make it so every room is different then to make an outside Functions to contain all the information of all the different room as.. follow:
This is the simple structure I came out with, it's jsut a global idea of how I'd do it:
Graphics 800,600,0 Global CurrentRoom:Int=0 Global intro:TRoom=New TRoom intro.Name="Intro" Global menu:TRoom=New TRoom menu.Name="Menu" While Not KeyHit(KEY_ESCAPE) UpdateRoom() Flip; Cls Wend; End Type TRoom Field Name:String End Type Function UpdateRoom() If CurrentRoom=0 Then ' Room Intro DrawText intro.Name,10,10 If KeyHit(KEY_ENTER) CurrentRoom:+1 EndIf EndIf If CurrentRoom=1 Then ' Room Menu DrawText menu.Name,10,10 EndIf End Function
What do you guys think? Any better ideas? Am I way off? Or over complicating stuff.. like I usually do lol?