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 / Guide Me for Create Tile Sprite

Author
Message
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 28th May 2014 17:01
Hi All.

I want begin make Platform game for android and purchased a sprite kit.

1- I need Know how can use tile sprite in AppGameKit? because there is no GUI for see What happens.
2- how can use clone Sprite tile and use them with Physics?

I attached two Sprite. can anyone show me how can use Sprite tile?

Thanks A Lot

Attachments

Login to view attachments
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 28th May 2014 17:29
These are 2 separate tiles, ideally you'd have them added to a tile sheet in an art package.

For example, you might have 64 tiles which you'd lay out on a 8x8 tile grid. Then in AppGameKit you'd load that tile sheet image and make a sprite, set it's animation to the cell size and number of frames, then you'd be able to just set the sprites frame to suit the tile number. You could also use a text object but that's a bit trickier.

AGK would prefer if you had a tile sheet, and cloned sprites from a 'brush' sprite, set the frame and position, and laid out your platforms that way. The chances are that this method would render much faster than using individual images, because the sprites that use a single tile sheet image can all be rendered at once, otherwise sprites need to be rendered depending on their image, so if every sprite used an individual image, they'd have to be rendered in turn.

Anyway, once you have the images organised how you need, it should just be a case of allowing physics on the sprites, make them static mode, set the frame/image and position them. I'd be happy to make a small example but you should look into compiling your tiles onto 1 image first.

I am the one who knocks...
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 28th May 2014 18:52 Edited at: 28th May 2014 18:57
Quote: "I'd be happy to make a small example but you should look into compiling your tiles onto 1 image first."


Thanks.You're a great help to me if give me a sample.

Attachments

Login to view attachments
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 28th May 2014 22:02
Here you go, any questions just ask.

I am the one who knocks...

Attachments

Login to view attachments
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 29th May 2014 20:15
Thanks Van B. I check it.
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 31st May 2014 14:25
Could you show me easier in this Project?

Thanks

Attachments

Login to view attachments
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 1st Jun 2014 08:53 Edited at: 1st Jun 2014 09:27
where is the Problem in my Project? don't show any thing.

Please Guide Me for fix this Problem.

Thanks.

Attachments

Login to view attachments
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 1st Jun 2014 14:01
Here you go. It still doesn't show the platforms, but they are at Y=100, so won't be shown unless you move them anyway.

I am the one who knocks...

Attachments

Login to view attachments
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 1st Jun 2014 17:22
Thanks Vab B.
but Don't Draw any thing (texture.png) in screen.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 1st Jun 2014 17:27
I think that if you change the position of the ground tiles you'll see them, they do work, but they're positioned off screen.

I am the one who knocks...
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 1st Jun 2014 18:36
don't work. why working with AppGameKit is very Hard?
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 1st Jun 2014 19:23
Try the code here:



I'm not used to working with percentage resolution

I am the one who knocks...
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 1st Jun 2014 20:45 Edited at: 1st Jun 2014 20:48
Thanks Van B.

could you explanation about these lines?



Thanks
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st Jun 2014 21:10 Edited at: 1st Jun 2014 21:11
Behdadsoft, are you actually trying or you just hoping someone does your project for you? Have you tried reading the help file?

That code says if the sprite doesn't exist then create it by cloning the original ground sprite. It will then position the sprite and set it's size (setting size is necessary when dealing with percentage)





You can use Tiled to create maps and import them using my TMX library. It doesn't use physics for collision, so you'd have to manually set that up.

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 1st Jun 2014 22:27
That just makes cspr if it doesn't exist, so it doesn't create sprites that it doesn't have to. Then it positions the sprite on a grid that is 11x8, so 0 to 10 on X, and 8 on Y multiplied by the sprite size.

I am the one who knocks...
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 8th Jun 2014 21:47
for clone another sprite I should create new Sprite?
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Jun 2014 22:29
For another platform?

You can just use that same sprite and clone it, you can always change the frame for different platform sprites. I think it would be best to use an incrementing number for the sprites though to avoid confusion. Like, start at 100 and increase by 1 every time you create a sprite, rather than letting AppGameKit assign the sprite number.

I am the one who knocks...
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 11th Jun 2014 13:25 Edited at: 11th Jun 2014 13:39
thanks Van B.

how can create Two rows Sprite?

I use this Code but don't work.

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 11th Jun 2014 13:45 Edited at: 11th Jun 2014 13:48
The issue you have there, besides a weird For Next loop, is that your using 100+n, then 100+n1, so your re-using the same sprites. I would just set cspr to 100, then increment it inside the loops, then there's no danger of overwriting your sprites...





So what I've changed here is that it only uses cspr, and it is set to 100 before the 2 loops, and incremented inside the loop, so cspr is always the next sprite you should use, just increment it everytime you create a sprite. I also changed the for next loops, I haven't been able to test it but I'm sure it should give 2 lines of sprites now.

I am the one who knocks...
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 11th Jun 2014 15:00
Thanks VanB Work very well.
3d point in space
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 13th Jun 2014 21:30 Edited at: 13th Jun 2014 21:35
tiled is a good way to go.

This is a program I made using tiled you can check it out.
The program does tiled pretty well for 2d. I just gave up on it though, but you still can use the tiled portion of the program. The usefull feature of this is it takes tiled and provides a easy to read export. The reason why it is for free is because every one here says there is no tiled editor, but i have used mine successfully several times for tiled.

The limitations of my program is that it only excepts one sprite sheet.

http://forum.thegamecreators.com/?m=forum_view&t=211185&b=8

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 13th Jun 2014 23:01
i have mentioned this before....however i will mention it again.

the famous TileStudio map files can easily be loaded into agk.

here was my original post about it.
http://forum.thegamecreators.com/?m=forum_view&t=206558&b=41

i even used tile studio for MassConflict levels released on bb/bb10/android/ouya

Login to post a reply

Server time is: 2024-11-25 06:55:31
Your offset time is: 2024-11-25 06:55:31