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 / How to show sprites from an array

Author
Message
Trisect Development
21
Years of Service
User Offline
Joined: 8th Sep 2002
Location: Denmark
Posted: 28th Jun 2015 21:43 Edited at: 28th Jun 2015 21:45
Its a long time since I coded in AppGameKit so I have forgotten a lot of things.

I want to make a playfield of lets sat 500x500 tiles and I want to use an array to show sprites.

Lets I have an array like:

[1, 1, 1, 1, 1, 1]
[1, 1, 1, 3, 1, 1]
[1, 2, 1, 1, 3, 1]
[1, 1, 2, 1, 1, 3]
[1, 1, 1, 2, 1, 1]
[1, 1, 2, 1, 1, 1]

And I have three sprites:
Dirt0.png - 1 in array.
Dirt1.png - 2 in array,
Dirt2.png - 3 in array,

Now how do I place them on screen like in the array?

Its in AGK2 and tier 1(basic).

Check my games for iPad, Android Tablet and PlayBook.
www.ipad-apps.dk
Waldemar Lima
9
Years of Service
User Offline
Joined: 27th Nov 2014
Location: Brasil
Posted: 28th Jun 2015 22:11
You must have another way to do what you want without using array

PrintC("Hello EveryOne !&quot
Trisect Development
21
Years of Service
User Offline
Joined: 8th Sep 2002
Location: Denmark
Posted: 28th Jun 2015 22:15
Why?

And how?
I need a big playarea with different sprites so I thought that array would be the best way to do it.
The array only contains the sprite number.

Check my games for iPad, Android Tablet and PlayBook.
www.ipad-apps.dk
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 29th Jun 2015 00:26 Edited at: 29th Jun 2015 00:29


Some pseudo code to prod you in the right direction

>Edit<
Forgot to add the image line :/

Trisect Development
21
Years of Service
User Offline
Joined: 8th Sep 2002
Location: Denmark
Posted: 29th Jun 2015 00:40
Thanks!

I'll take it from here.

Check my games for iPad, Android Tablet and PlayBook.
www.ipad-apps.dk
Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 29th Jun 2015 00:49
I use strings for levels, then i use string functions to check what characters is in the string, and place the sprites accordingly.

Part of the function to make levels:



----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.

Login to post a reply

Server time is: 2024-03-28 20:18:53
Your offset time is: 2024-03-28 20:18:53