Card game shapes!!! moving procedures!!!
Author |
Message |
xHoly-Divinity
|
Posted: Thu Dec 02, 2004 10:41 am Post subject: Card game shapes!!! moving procedures!!! |
|
|
code: |
proc club (var xx, yy : int)
drawfilloval (400 + xx, 100 + yy, 7, 7, black)
drawfilloval (392 + xx, 90 + yy, 7, 7, black)
drawfilloval (408 + xx, 90 + yy, 7, 7, black)
Draw.ThickLine (400 + xx, 90 + yy, 400 + xx, 75 + yy, 5, black)
Draw.ThickLine (396 + xx, 74 + yy, 404 + xx, 74 + yy, 3, black)
end club
club (50, 50)
|
I do not know what is wrong with the code. It doesn't move the procedure. I get an error stating 'non variable passed to variable format' |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Delos
![](http://www.members.shaw.ca/rfolz/delos_avatar.gif)
|
Posted: Thu Dec 02, 2004 10:45 am Post subject: (No subject) |
|
|
Your paramters for your proc have been declared in variable format. Instead, declare your procedure as:
code: |
proc club (xx, yy : int)
%...
|
This way the paramters may be hardcoded ints or variables, but may not be editted at anypoint during the proc. |
|
|
|
|
![](images/spacer.gif) |
xHoly-Divinity
|
Posted: Thu Dec 02, 2004 11:17 am Post subject: (No subject) |
|
|
Ahhh ic ic. Thank you. But now I am having another problem. I am using the drawfillpolygon command and I end up getting an error.
code: |
procedure spade (xx, yy : int)
drawfilloval (113 + xx, 98 + yy, 12, 10, black)
Draw.ThickLine (113 + xx, 98 + yy, 113 + xx, 80 + yy, 7, black)
Draw.ThickLine (105 + xx, 79 + yy, 120 + xx, 79 + yy, 3, black)
var x : array 1 .. 3 of int := init (100 + xx, 126 + xx, 113 + xx)
var y : array 1 .. 3 of int := init (100 + yy, 100 + yy, 119 + yy)
Draw.FillPolygon (x, y, 3, black)
end spade
spade (50, 50)
|
I have tried doing it that way and
code: |
procedure spade (xx, yy : int)
drawfilloval (113 + xx, 98 + yy, 12, 10, black)
Draw.ThickLine (113 + xx, 98 + yy, 113 + xx, 80 + yy, 7, black)
Draw.ThickLine (105 + xx, 79 + yy, 120 + xx, 79 + yy, 3, black)
var x : array 1 .. 3 of int := init (100, 126, 113)
var y : array 1 .. 3 of int := init (100, 100, 119)
Draw.FillPolygon (x+xx, y+yy, 3, black)
end spade
|
that way. But for both I get an error. I really need help with this if there is a way to fix it!!!!!! |
|
|
|
|
![](images/spacer.gif) |
Viper
![](http://compsci.ca/v3/uploads/user_avatars/20678142424cb7690e076fe.jpg)
|
Posted: Thu Dec 02, 2004 2:09 pm Post subject: (No subject) |
|
|
try putting the polygon somewhere else bc i think the problem is with the x+xx and y+yy since xx and yy havent been previously declared it has nothing 2 add 2 x and y im not totaly sure though |
|
|
|
|
![](images/spacer.gif) |
Delos
![](http://www.members.shaw.ca/rfolz/delos_avatar.gif)
|
Posted: Thu Dec 02, 2004 3:25 pm Post subject: (No subject) |
|
|
I couldn't tell you why, but replace the init clause with direct initializations, and it will work.
Perhaps someone who could translate "compile time expression"...I used to know what that meant...something about certain things that must be computable before compilation...[sigh] |
|
|
|
|
![](images/spacer.gif) |
|
|