Computer Science Canada Grids, Backgrounds, Music, Movement, Interaction, and then some. |
Author: | CastlevaniaBird [ Sun Apr 03, 2011 4:59 pm ] | ||
Post subject: | Grids, Backgrounds, Music, Movement, Interaction, and then some. | ||
What is it you are trying to achieve? Three years after I took a programming class, I forget ~95% Of my coding. I am trying to create a game that plays roughly like Pokemon (Yeah, another knock-off.) called "Turingmon". Creative, right? Well, that's where Compsci comes in. I'm going to be hammering away at this, and I will be needing a lot of help. I figured it's easiest to set up a thread early, rather than get neck-deep in crud, get mad, and then relay that rage onto all of you. So, that's what I'll do. What is the problem you are having? First Issue to address: Organization into "for loops", as well as variable fixing. Describe what you have tried to solve this problem Tried a few different placements of "For" And eventually settled without a loop, thus expanding my code way too much. Also, set a bunch of variables, not sure which are correct. Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) Current looks of the code - yes, it's painful. Also, tried to indent and got "NOT ENOUGH MEMORY TO INDENT", so sorry. D:
Please specify what version of Turing you are using 4.1.1 |
Author: | Raknarg [ Sun Apr 03, 2011 5:59 pm ] |
Post subject: | RE:Grids, Backgrounds, Music, Movement, Interaction, and then some. |
1: Your picwidth and picheight are redundant, as you can call them as they are in your variable settings. Instead of having a vairable for picheight1, you could just call Pic.Height (picture). 2: Instead of having a different variable for every picture, use one string. Remember that the Pic.FileNew is asking for a string, so you can replace that with a variable. To do that, you would just call a new picture every time the direction changes, and replace the string with the new picture 3: I see you use (bgwidth2 - picwidth2) div 2 and (bgwidth2 - picwidth1)div 2 and.... so on. I don't think you can do that; if you're trying to add them, use +. I would fix those things first. |
Author: | CastlevaniaBird [ Sun Apr 03, 2011 6:06 pm ] |
Post subject: | RE:Grids, Backgrounds, Music, Movement, Interaction, and then some. |
Well, the movement works so far, so I think that coding works, but yes, it's ugly as sin. Also, all of that picheight variable-ism isn't needed? I can just take it all out? Finally, I don't remember enough from class two years ago to call a picture from a string. Any reminders? Thanks. |
Author: | Raknarg [ Sun Apr 03, 2011 6:11 pm ] |
Post subject: | RE:Grids, Backgrounds, Music, Movement, Interaction, and then some. |
kk. So no, you don't need a variable for Pic.Height. You can I suppose, but that's why there's a predefined function for it. And calling a picture is generally something people don't teach it seems, I thought of it myself (though obviously I don't take credit for inventing it, I'm sure others have discovered it ![]() Ex. var picname : string := "Bedroom2.jpg" var pic : int := Pic.FileNew (picname) That way you only need 2 variables: one for the picture name and one for the actual picture. |
Author: | Tony [ Sun Apr 03, 2011 6:14 pm ] |
Post subject: | RE:Grids, Backgrounds, Music, Movement, Interaction, and then some. |
You can catch up on Turing with The Turing Walkthrough. It will definitely be helpful. Reconsider your design. It would be very helpful to have the game be driven by a single "main loop" and have various levels of abstraction. You'd definitely want to have things like dialogs to be coming from data files rather than code. |
Author: | CastlevaniaBird [ Sun Apr 03, 2011 6:19 pm ] |
Post subject: | RE:Grids, Backgrounds, Music, Movement, Interaction, and then some. |
Now mentioning that dialog from separate files does sound a lot easier - I don't recall them teaching me that when I took the course - but that was also two years ago. Looking at what I'm reading, It sounds easier to scrap the code I've got now and start from scratch. On that note, the Turing Tutorial link is what got me to where I was in my program, haha. A bit to wrap my head around in two hours, but still, I bookmarked the link for when I either restart or progress on my program. |
Author: | Tony [ Sun Apr 03, 2011 6:33 pm ] |
Post subject: | RE:Grids, Backgrounds, Music, Movement, Interaction, and then some. |
Strong suggestion for such a large project -- set yourself up with source control system. GitHub has free accounts for students -- https://github.com/edu It might be some work to set it up and get used to the workflow, but it's basically a requirement in real world, and will save your project when you accidentally overwrite a file, or your hard-drive crashes. |
Author: | CastlevaniaBird [ Sun Apr 03, 2011 6:35 pm ] |
Post subject: | RE:Grids, Backgrounds, Music, Movement, Interaction, and then some. |
Thanks for the suggestion. I'll check it out. +Karma. (at least, +Karma when I get 25 points. Hahaha.) |