Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Updating usertype in array?

Author
Message
Fluorescent
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 1st Aug 2005
Location: Stockholm, Sweden
Posted: 7th Aug 2015 18:38
I've having some fun working on a Sokoban clone. And now I'm reworking it from having one hardcoded level to load levels from files.

I've made a type to represent a tile in the level and I store these in an array.


The Crate property is the ID for a sprite that represents a crate if the crate is on that tile. When the player moves a crate I move it using SetSpriteTweenX and Y and then I thought I do something along the lines of

Thus updating the array on where the crate moved. However nothing happens when I do that, the array doesn't change. I tried to switch the position of the tiles but that doesn't seem to work either.

Any suggestions on what I'm doing wrong?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 7th Aug 2015 20:50
the easy way is to print the properties on screen.

AGK (Steam) V2 Beta .. : Windows 10 Pro, 8.1 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Fluorescent
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 1st Aug 2005
Location: Stockholm, Sweden
Posted: 7th Aug 2015 20:53
I found the problem. It was me who changed the index for the tiles in the array in the wrong order.

Once I managed to set the index correctly in my function it works as it's supposed to.

Login to post a reply

Server time is: 2024-11-25 19:22:37
Your offset time is: 2024-11-25 19:22:37