|
Post by egotrip on Apr 28, 2013 17:00:12 GMT
How do you move from room to room? I have designed some and edited the map. I have tried the code
if key 0 if x <= 16 screenleft let x = 256 else (rest of code)
and similar for each other direction, yet it completely refuses to work. Am I doing something wrong, or is there a bug in the CPC version?
|
|
|
Post by Jonathan Cauldwell on Apr 28, 2013 18:53:38 GMT
X is the vertical position, Y is horizontal. 256 is twice the horizontal resolution, so I'm guessing something like
IF Y <= 16 SCREENLEFT LET Y = 106 EXIT ELSE ...
is more along the lines of what you're after.
|
|
|
Post by egotrip on Apr 28, 2013 21:20:26 GMT
thanks I will try this out. It seems to be working ok now.
Why are x and y swapped around in AGD? x is horizontal in pretty much every other thing I've used.
|
|
|
Post by Jonathan Cauldwell on May 1, 2013 20:30:29 GMT
Historical reasons mostly. When calculating the screen address it makes sense to use the first variable to store the number of pixels from the top of the screen and the second one to indicate the number of pixels from the left edge. And I don't like putting Y before X...
|
|