Computer Science Canada help with polygons |
Author: | skier [ Fri Oct 22, 2004 8:03 pm ] | ||
Post subject: | help with polygons | ||
this is for a pacman game. im trying to make the ghost so that it is easy to mave what am i doing wrong? i get an error "compile time expression expected" ![]() heres the code:
|
Author: | skier [ Fri Oct 22, 2004 8:10 pm ] |
Post subject: | |
the last number for "x1" is 8 then ) |
Author: | skier [ Fri Oct 22, 2004 8:16 pm ] |
Post subject: | |
any body this is realy important ergent |
Author: | zylum [ Fri Oct 22, 2004 9:37 pm ] | ||
Post subject: | |||
im assuming that x and y are variables.... thats why you get the error. when you initialize arrays you can only use constants or numbers. if your using variables, you need to manually input the data ie
|
Author: | Tony [ Fri Oct 22, 2004 9:48 pm ] | ||
Post subject: | |||
there also seems to be a pattern in your coordinates, so you might employ a forloop... or just copy paste (although that's a bad practice) bottom line: replace var x,y:int with
|
Author: | skier [ Sat Oct 23, 2004 8:13 am ] |
Post subject: | |
but to make this ghost move there must be an increase in the x's and y's. if it is a constant i can not do so. |
Author: | Cervantes [ Sat Oct 23, 2004 9:36 am ] | ||
Post subject: | |||
as tony said, there is a pattern to your x1 and y1 array. You can make use of that patter:
That will be even more helpful because I imagine you are going to have to change the x1 array each time through the loop. |