|
Post by eyfenna on Jul 17, 2019 9:48:45 GMT -6
I got back into coding in RCBasic, all is nice and works, however a thing I used in the past a sub that calculates ceneterpoints of a hexgrid (pointy-top) doesn't compile:
Sub centerpoint(x,y,spacing, byref px, byref py) dx = x*spacing*2
If y%2 = 1 px = dx + spacing Else px = dx End If
dy = y*spacing
If y = 0 py = dy Else py = dy + spacing /2 End if
End Sub
bit of a confusion to me.
Edit found the problem.
|
|
|
Post by johnno56 on Jul 17, 2019 10:17:03 GMT -6
My guess would be... missing a 'then' on lines 4 and 12?
I'm not 100% sure, but line 4 might be 'y mod 2' as well... Don't quote me on that one... lol
J
|
|
|
Post by eyfenna on Jul 17, 2019 10:23:17 GMT -6
Yes the then was missing. I was in c++/go mode where it is if(condition) {do thing} or if condition{do thing}
|
|
|
Post by johnno56 on Jul 17, 2019 13:57:37 GMT -6
No problemo... Glad it worker out for you. Have a great day...
J
|
|