I'm working on a little shmup where the enemy ships are supposed to come from the top of the sceen.
What i need is a way to read numbers from a file, where each row is a certain second of the level and each digit after the "=" is an enemy ship type/ship formation, like:
1=0
2=0
3=1
4=0
5=1
6=1
7=2
and so on...
i was thinking of using the "Array Object" but i have no way to edit those files with something like a texeditor.
Is there a (or a billion) solution(s) for my problem?
you can use the array. You can also edit the array in-game when you test you application. In the debug box on the top, add the array object to the debugger and you can check/change the values.
When you load the array, you can use the "string parser 2" object and set the delimiter to "=". Then you get the left/right of the string entered in the array to separate the data.
Originally Posted by Sumo148 You can also edit the array in-game when you test you application. In the debug box on the top, add the array object to the debugger and you can check/change the values..
What you CAN? Woo Hoo!
Never used the debugger ever before, maybe I should.
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
Originally Posted by Lelle I'm working on a little shmup where the enemy ships are supposed to come from the top of the sceen.
What i need is a way to read numbers from a file, where each row is a certain second of the level and each digit after the "=" is an enemy ship type/ship formation, like:
1=0
2=0
3=1
4=0
5=1
6=1
7=2
and so on...
i was thinking of using the "Array Object" but i have no way to edit those files with something like a texeditor.
Is there a (or a billion) solution(s) for my problem?
Use the ini object. That's the simplest way to do what you want to do.
Next is the Array object, which you can edit in the debugger as Sumo said.
I don't see a real problem with using a timer in this situation. I know counters are good practice but I think computers are capable of counting the length of one second.
Timers might work if it's running at a steady pace (like if you can't speed up or whatever). Although I wouldn't trust them at all, if theres slowdown then the timing will break. They only work if the FPS doesn't change from the original speed it was developed to use.
I made it more complicated than it needed to be, just so the data files are a bit more intuitive.
They're basically just text files where each line represents one event, and has a structure like this:
M'SS"T - ObjectToCreate - PositionCreateObject
(M=minutes, SS=seconds, T=tenths of a second incase you were wondering).