|
Post by lammers on Oct 4, 2019 22:17:40 GMT
Hello, does anyone have any ideas what's could be happening with this?: The player sprite can use a 2 block wide ladder when the game starts. If I leave this initial screen and return immediately, the ladder is no longer usable. However, a 3 block wide ladder remains fine. It would seem that the 2 block wide ladder stays happy until there's a screen change, after which all ladders that are 2 blocks wide stop working as expected, but 3+ aren't affected. I've been fighting this for days and even rebuilt the project in a new instance of AGDx4.7X4Mg. I then started stripping everything out bit by bit until I got down to the bare bones, and find that I still have this bizarre behaviour. strip down for ladder problem.szx (27.33 KB) On a side note, is ADGx considered stable enough for creating a full game? I've encountered other issues with ADGx while working on this, my first speccy project in decades.
|
|
|
Post by Jonathan Cauldwell on Oct 5, 2019 13:45:45 GMT
Don't worry, this is very simple.
To go up or down a 2-block wide ladder the sprite's horizontal position must be straddling the 2 character blocks with a coordinate divisible by 8. Sprites start aligned at character cell positions and move left or right 2 pixels per frame. When you change the screen you set the player's horizontal position to a new value. In this case you are setting the coordinates to odd values, 3 or 237. Subsequently when your sprite is moved left or right it continues to move 2 pixels per frame, but now your coordinates are stuck on odd values so the sprite is never aligned with the ladder.
I confess to not knowing AGDx script very well but took a quick look at your snapshot and there are two lines you want to change in the player event. Change LET Y 3 to LET Y 4 and change LET Y 237 to LET Y 236 and this should fix your problem
|
|
|
Post by alessandro on Oct 5, 2019 14:15:34 GMT
Hi lammers and welcome to the AGD forum AGDx is certainly stable enough in my experience, I employed it to produce my latest games, as other folks did. Sophia II in particular features in its third level two-block wide ladders, just like the demo you posted, but shows none of such behavior. It was made with AGDx Ke I made a demo like yours from scratch, and with the same version of AGDx, but no problems surfaced: laddertest.szx (25.7 KB) However, there is definitely something going wrong: I experienced disappearing and reappearing lines in the P0 code while I was editing it. Could this be somehow related to the issue you found? Edit: Jonathan answered while I was examining the problem
|
|
|
Post by lammers on Oct 5, 2019 19:00:20 GMT
Change LET Y 3 to LET Y 4 and change LET Y 237 to LET Y 236 and this should fix your problem And indeed it does, thank you! I don't recall seeing that 2px alignment in the docs, I'll have to re-read them. However, there is definitely something going wrong: I experienced disappearing and reappearing lines in the P0 code while I was editing it. Could this be somehow related to the issue you found? I get that all the time when editing, it's very frustrating seeing lines constantly disappear, (and ctrl+Q saving when the doc says otherwise). I've just assumed ADGx was a little borked. I'll post a funny bug a later. (more likely tomorrow when the pub haze clears, my head is spinning). I can make P0 stick to a wall block type and then climb the wall with not-quite ninja keyboard jabbings. Perhaps not, the off by one was causing this too...
|
|
|
Post by lammers on Oct 7, 2019 15:26:54 GMT
Change LET Y 3 to LET Y 4 and change LET Y 237 to LET Y 236 and this should fix your problem And indeed it does, thank you! I don't recall seeing that 2px alignment in the docs, I'll have to re-read them. Why is the Y variable used to hold the sprite's X position, and likewise with the Y position in X? (I've just been chasing my tail looking for objects that didn't appear)
|
|