Posted: 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:
code:
View.Set ("graphics")
var x, y : int
x := 300
y := 200
var x1 : array 1 .. 11 of int := init (x - 8, x - 8, x - 6, x - 4, x - 2, x, x + 2, x + 4, x + 6, x + 8, x + 8)
var y1 : array 1 .. 11 of int := init (y, y - 20, y - 22, y - 20, y - 22, y - 20, y - 22, y - 20, y - 22, y - 22, y)
Posted: Fri Oct 22, 2004 8:10 pm Post subject: (No subject)
the last number for "x1" is 8 then )
skier
Posted: Fri Oct 22, 2004 8:16 pm Post subject: (No subject)
any body
this is realy important
ergent
zylum
Posted: Fri Oct 22, 2004 9:37 pm Post subject: (No 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
code:
x1(1) := x + 1
y1(1) := y + 1
x1(2) := x + 8
y1(2) := y + 8
//etc...
Tony
Posted: Fri Oct 22, 2004 9:48 pm Post subject: (No 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)