|
Post by kas29 on Feb 10, 2013 13:35:48 GMT
Hello! Tell me, my character had to fall from the top screen to the bottom screen .. He falls, but the screen does not change .. here's some code .. ... IF X >= 172 SCREENDOWN LET X = 26 EXIT ENDIF ... What am I doing wrong? Location on the map screen.. 04 03 00 01 02 to fall down... 04 v 00 ?
|
|
|
Post by 10loadgameplay on Feb 12, 2013 16:40:12 GMT
Hey kas29, I struggled with this problem too. The method I used was to display the x co-ordinate onscreen & when the sprite fell I could see if it crossed the threshold (in your case 172). It could be that 172 is too high & needs reducing by 8 or 16 pixels. In Main Loop 1 add something like: let line = 0 let column = 0 Display I In Player Control Type 0 Let I = x The X co-ord will now be displayed in real-time in the top left corner of the screen. Hope this helps NB: Not sure if this was a typo in your code, but my code looks like this: IF X = > 146 SCREENDOWN LET X = 8
|
|
|
Post by nra on Feb 12, 2013 23:25:51 GMT
First, the sprite is upper-left aligned. - check coords as suggested by 10loadgameplay
Second, the whole block code will be proceeded to the end before triggering the windows change. - use break/exit or flag
Cheers.
|
|
|
Post by kas29 on Feb 13, 2013 15:35:05 GMT
Wow .. Thank you guys! Understood ..) That's just one caveat .. let the rope from one screen to another .. hero jumps on the rope and ... falls to the bottom .. but the screen does not move .. and when it goes up and down all ok .. here's the video .. rghost.ru/private/43771703/52ee85422ecd97e887bf0c91d3c150c4
|
|
|
Post by Jonathan Cauldwell on Feb 15, 2013 16:23:14 GMT
IF X >= 172 SCREENDOWN LET X = 26 EXIT ENDIF ... What am I doing wrong? Confusingly, you can't do >= with AGD. There are only 4 comparisons you can use: > greater than <= less than or equal to = equal to <> not equal to. So try using this to test your player's position instead: IF X > 171 and it should work for you.
|
|
|
Post by kas29 on Feb 15, 2013 17:22:18 GMT
Now, yes .. all is well. We had to put a ">" instead of "> =" Thanks Jonathan!
|
|