Computer Science Canada platformer problem |
Author: | slender0123 [ Fri Sep 06, 2013 9:40 am ] | ||
Post subject: | platformer problem | ||
What is it you are trying to achieve? make my text from a .txt appear on screen as the platforms What is the problem you are having? not appearing
Please specify what version of Turing you are using 4.1 im pretty sure |
Author: | evildaddy911 [ Fri Sep 06, 2013 11:29 am ] |
Post subject: | RE:platformer problem |
where do you actually draw the text from the file? |
Author: | slender0123 [ Fri Sep 06, 2013 7:20 pm ] |
Post subject: | RE:platformer problem |
too be brutily honist, I really dont know lmao, im 100% new to this, I thought a little to big for my first thing to make, but, I gotta learn somehow lol. I'm pretty sure I'm getting the text from the file, i just need to get it drawn. |
Author: | Raknarg [ Fri Sep 06, 2013 7:52 pm ] |
Post subject: | RE:platformer problem |
What is your screen but a 2D array of pixels? It's no different than your 35x35 array of text. Split your screen into 35x35 segments, and draw each platform in the corresponding slot. |
Author: | slender0123 [ Fri Sep 06, 2013 8:08 pm ] |
Post subject: | RE:platformer problem |
That would take a lot of coding though, would it not? |
Author: | Nathan4102 [ Fri Sep 06, 2013 8:50 pm ] |
Post subject: | RE:platformer problem |
Not at all! Look into case statements, if you haven't already, and you should be able to paint the map in a decent amount of lines. Post your code here if you want and we can tell you how it is. Something like this: case (character in your .txt) of: a: draw ...; b: draw ...; c: draw ...; end case Or, if youre using pictures rather than single pixels/characters, you could name your files exactly what they'd be in the .txt + the bmp, and then use this: for ... drawpic(text(i) + ".bmp", ...) end for Sorry for the lazy coding/examples, I'm just getting off to bed now, and I don't feel like doing this all properly, but you should get the idea and be able to come up with the code yourself. Good luck! |
Author: | Raknarg [ Sat Sep 07, 2013 9:20 am ] | ||
Post subject: | RE:platformer problem | ||
If you have tile pictures named the same as the numbers in the text file, it should be fine. Or if you dont want to use pictures, just take the second part of my example and replace it with Draw.FIllBox or something |