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 / Read & Data Statements?

Author
Message
JHA
20
Years of Service
User Offline
Joined: 30th Dec 2003
Location: Massachusetts, USA
Posted: 26th Aug 2011 19:57
Will these be supported or do we need to use the File commands with arrays?

Example: I want to build a level map that determines what image to use where. In DBPro we can use Read and Data statements, but that doesn't appear to be an option here.

Thanks
JHA
Daniel TGC
Retired Moderator
17
Years of Service
User Offline
Joined: 19th Feb 2007
Location: TGC
Posted: 26th Aug 2011 23:17
You need to use file commands.
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 26th Aug 2011 23:29
You could get tricksy and instead of a bunch of data statements, use a bunch of assignment statements.



and so on. m[x] is the same length to type as DATA, until you reach x > 9.

JHA
20
Years of Service
User Offline
Joined: 30th Dec 2003
Location: Massachusetts, USA
Posted: 26th Aug 2011 23:47
Thanks Guys! I like that approach Rich. I may use it.

JHA
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 27th Aug 2011 20:07
Unfortunately you have to use strings as people have suggested. I much prefer the simple data commands for internal work however, and hope they will be added in future updates.

3d point in space
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 28th Aug 2011 07:22
use vectors I did a 3d vector solver that used 0's and 1's to represent a maze in 3d. So this should not be any different.

Go through yourself at a wall.
JHA
20
Years of Service
User Offline
Joined: 30th Dec 2003
Location: Massachusetts, USA
Posted: 1st Sep 2011 20:37 Edited at: 1st Sep 2011 20:39
Hello All,

Thanks for the feedback! Although I do prefer the Read/Data/Restore method, Rich's method above is working perfectly.

See the code below for a simple but working method:



This is for a single Wall image at 32x32, but it can be expanded to add different images for doors, items, etc...

The SetSpriteDepth command can be used for moving sprites above and below other sprites too, so I'm loving AppGameKit so far!!

Thanks again!!

JHA
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 2nd Sep 2011 05:19
We thought about retaining DATA, READ and RESTORE but they are very legacy these days, and the modern way of thinking puts data nice and separate in a file or in the cloud somewhere. We did add something to make life a little easier though, you can do this:

dim mydata$[10] as string = [ "a", "b", "c" ]

Perhaps not as elegant as mixed type data statements, but a cool way to group together data items and associate them with an array structure in a single line

I drink tea, and in my spare time I write software.

Login to post a reply

Server time is: 2024-11-21 17:52:05
Your offset time is: 2024-11-21 17:52:05