atempted game first program need feedback
Author |
Message |
Jimbo 420
|
Posted: Thu May 25, 2006 1:25 pm Post subject: atempted game first program need feedback |
|
|
i just started turing and this is my first game i need feedback thanx
Description: |
|
 Download |
Filename: |
finalProject.t |
Filesize: |
10.02 KB |
Downloaded: |
236 Time(s) |
|
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
[Gandalf]

|
Posted: Thu May 25, 2006 11:27 pm Post subject: (No subject) |
|
|
Quick post: There are tons of good tutorials and heaps of good information about Turing in the Turing Walkthrough located in the [Turing Tutorials] section, you'll definately want to take a look there in the future for tips on how to improve and add to your code.
You'll also want to give credit for code you copied off this site. I recognize "Nothing Else Matters" which was adapted to Turing by another member, who you will want to credit in your source code if not in the program itself.
|
|
|
|
|
 |
TheOneTrueGod

|
Posted: Fri May 26, 2006 7:21 am Post subject: (No subject) |
|
|
The game doesn't seem to work too well... Also, your instructions aren't very clear. What is "My shield". why does (what I assume to be my shield) start off an entire screen away from me. What are "My enemies"? I thought they were the balls... so how can I deflect the balls at themselves?
Finally, in respect to gameplay, its almost impossible to reflect balls when they approach from the side, not to mention the fact that the black circle is drawn OVER the shield, so the balls hit it instead of hitting your paddle.
Aside from that, your code is pretty bad... (I'm not trying to be mean). Boolean operators are your friend.
code: |
if View.WhatDotColour(x + 9,y) = yellow [b]or[/b] View.WhatDotColour(x + 9,y) = orange then
%Do collision stuff
end if
|
Your program definetly doesn't need to be 400 lines. Using the method above, you can take off at least 100. If you learnt arrays, you could take off another 100 probably, and also have dynamic objects.
Finally, lets take a look at some optimization...
code: | if choice = 1 then
if whatdotcolour (x + r + 10, y) = black then
deltaX := -deltaX
counter := counter - 5
elsif whatdotcolour (x - r - 10, y) = black then
deltaX := -deltaX
counter := counter - 5
elsif whatdotcolour (x, y + r + 10) = black then
deltaY := -deltaY
counter := counter - 5
elsif whatdotcolour (x, y - r - 10) = black then
deltaY := -deltaY
counter := counter - 5
end if
exit
elsif choice = 2 then
if whatdotcolour (x + r + 10, y) = black then
deltaX := -deltaX
counter := counter - 10
elsif whatdotcolour (x - r - 10, y) = black then
deltaX := -deltaX
counter := counter - 10
elsif whatdotcolour (x, y + r + 10) = black then
deltaY := -deltaY
counter := counter - 10
elsif whatdotcolour (x, y - r - 10) = black then
deltaY := -deltaY
counter := counter - 10
end if
exit
elsif choice = 3 then
if whatdotcolour (x + r + 10, y) = black then
deltaX := -deltaX
counter := counter - 15
elsif whatdotcolour (x - r - 10, y) = black then
deltaX := -deltaX
counter := counter - 15
elsif whatdotcolour (x, y + r + 10) = black then
deltaY := -deltaY
counter := counter - 15
elsif whatdotcolour (x, y - r - 10) = black then
deltaY := -deltaY
counter := counter - 15
end if
exit
else
put "Invalid choice. Please enter 1, 2 or 3 as instructed."
delay (2000)
end if |
Ouch... if you look in there, theres a LOT of repeated code... And why do you even need it all? It seems to me that you are managing this in the main loop anyways... A lot of that code can be managed MUCH better, example
code: |
if choice = 3 or choice = 2 or choice = 1 then
if whatdotcolour (x + r + 10, y) = black then
deltaX := -deltaX
counter := counter - 5 * choice
elsif whatdotcolour (x - r - 10, y) = black then
deltaX := -deltaX
counter := counter - 5 * choice
elsif whatdotcolour (x, y + r + 10) = black then
deltaY := -deltaY
counter := counter - 5 * choice
elsif whatdotcolour (x, y - r - 10) = black then
deltaY := -deltaY
counter := counter - 5 * choice
exit
else
put "That wasn't a chioce."
end if
end if
|
As you can see, just applying the math you allready know, you can shorten code by a helluva lot.
Anyways, good luck, and please keep in mind that shorter code that accomplishes the same thing is better code.
|
|
|
|
|
 |
_justin_
|
Posted: Mon May 29, 2006 7:27 pm Post subject: (No subject) |
|
|
eh jim i will show you a few things that you can inprove on tomarrow in class like maybe draw the paddle on the screen instead of having to move it onto the screen but otherwise its pretty good (one of the better games in our class)
|
|
|
|
|
 |
ohgeez_

|
Posted: Mon May 29, 2006 10:50 pm Post subject: (No subject) |
|
|
okk. pretty well done. but as they've said above. ur code can definitely be shortened
- i find that ur collision detector isnt the very best. cant detect everything
- u can probably use procedures in ur program instead of all those if statements in each other
- arrays
- length of code
- make shield more obvious when u start
u can set values to a variable by simply declaring the variable like this:
code: | var counter : int := 0 |
- do u really need to Input.KeyDowns in there?
its not bad =D
fix somethings here and there. and it'll be fine
good luck on ur summative.
|
|
|
|
|
 |
_justin_
|
Posted: Tue May 30, 2006 3:56 pm Post subject: (No subject) |
|
|
yea but for our class the teacher hasn't gone that indepth with array,procedures with them so he is kinda limited to what he can write
|
|
|
|
|
 |
- IzAk -

|
Posted: Mon Jun 05, 2006 1:27 pm Post subject: (No subject) |
|
|
turtles smell bad...
|
|
|
|
|
 |
Mr. T

|
Posted: Mon Jun 05, 2006 5:28 pm Post subject: Alex's Opinion |
|
|
- IzAk - wrote: turtles smell bad...
Cut the spam.
|
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Clayton

|
Posted: Mon Jun 05, 2006 8:45 pm Post subject: (No subject) |
|
|
[quote="- IzAk - 's Signature]
- I Saw Your Mom On The Internet -
- Let's Go Down To The Boozen'puki'n, Free Beer On This Mother Furher. -
[/quote]
plz change your signature to something more..polite, read [The Rules] to find the description of an acceptable signature
now on to the game, as TheOneTrueGod stated, code optimization is your friend:D theres a lot of repetition (refer to above post). collision detection is a bit.....off, somehow the one of the balls made it inside of the black ball and i was unable to stop it other than that, one of the better first games posted here, but can still use some major improvement check the Turing Walkthrough for ways to improve your game and learn stuff along the way:D
|
|
|
|
|
 |
Dodad bouldershoulder

|
Posted: Tue Jun 06, 2006 10:38 am Post subject: (No subject) |
|
|
I think Jimbo 420 signature is hilarious!!!That's a good one!
|
|
|
|
|
 |
_justin_
|
Posted: Tue Jun 06, 2006 11:28 am Post subject: (No subject) |
|
|
ahahh thats a really good
|
|
|
|
|
 |
HellblazerX

|
Posted: Tue Jun 06, 2006 5:18 pm Post subject: (No subject) |
|
|
Obvious, Jimbo420 didn't read the rules when making his signature.
|
|
|
|
|
 |
Remm

|
Posted: Tue Jun 06, 2006 7:29 pm Post subject: (No subject) |
|
|
Uh, a side point: if, as you said, have just started turing, then why is the file labeled 'final project' ? not to be a grammer nag or anything, it just struck me as odd
anyways, I agree with the optimization, even if you'd rather your teacher sit there and sift through your code for hours in the end it'l result in a poorer mark. Anyways, you'll want to cut down on repitition and whatnot for if you ever need to do mass changes where the replace tool cannot be used. Wouldn't it suck if you had to change somthing in each repitition for like every line?
|
|
|
|
|
 |
Jimbo 420
|
Posted: Thu Jun 08, 2006 11:52 am Post subject: yah |
|
|
its called final project because i quit adding to it so its done as to what im doing to it labelling it the final project
|
|
|
|
|
 |
BlackDragon989
|
Posted: Wed Jun 14, 2006 1:16 pm Post subject: game |
|
|
OMG SICK GAME JIM WOWZ!!!!!!!!
|
|
|
|
|
 |
|
|