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 / Introduction to the AKG and the first question.

Author
Message
Sharisu
12
Years of Service
User Offline
Joined: 9th Nov 2011
Location: BY, Minsk
Posted: 9th Nov 2011 09:12
Good afternoon.
I decided to try the AKG. I had a couple of questions, I hope you can help.
1. What size are needed tecture for the iPhone? How do I know need the square tecture, but you use the examples of any size. How so?
2. In the game you need to combine the elements of how to draw a line between them and how do I check if this does not cross the line you have already created?
Dybing
12
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 9th Nov 2011 11:57
1: All graphical elements should be divisible by 8 giving an integer result. Textures, sprites, background images, font-maps etc. So 64x64 and 128x32 is ok, whilst 50x50 or 100x25 isn't.

Having graphics with dimensions that are not readily divisible by 8 will work on some platforms (like say PC/Mac), but will create problems for you when trying to run your project on less forgiving operating systems. Like say iOS and probably Android as well.

2: Don't understand the question.
Sharisu
12
Years of Service
User Offline
Joined: 9th Nov 2011
Location: BY, Minsk
Posted: 9th Nov 2011 15:20
1. Thank you) If I understood correctly, I can use rectangular textures, not necessarily square?

2. Yes, it is very difficult asked. My English is not very good)
How do I draw a line from point to point, using the texture. And how can I check in the construction of the next line, not whether it crosses the line.
Hopefully able to explain.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 9th Nov 2011 22:55
My graphic files are not divisible by 8 and they run fine on PC and iOS.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 10th Nov 2011 12:56
Quote: "All graphical elements should be divisible by 8"

Actually, it doesn't matter at all what size they are, but it's recommended they be powers of 2. (So 2x2, 4x4, 8x8, 16x16, 32x32, 64x64 and so on)

My signature is NOT a moderator plaything! Stop changing it!
Dybing
12
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 11th Nov 2011 11:30
Quote: "Actually, it doesn't matter at all what size they are, but it's recommended they be powers of 2. (So 2x2, 4x4, 8x8, 16x16, 32x32, 64x64 and so on)"
Oooops, sorry, my bad. Powers of 2 it is. I've just made sure its powers of 8, and have had no problems, but ofcourse, any power of 8 is also a power of 2

Quote: "1. Thank you) If I understood correctly, I can use rectangular textures, not necessarily square?"
Yes. Sprites and other graphical elements can be rectangles, they do not need to be squares.

Quote: "2. Yes, it is very difficult asked. My English is not very good)
How do I draw a line from point to point, using the texture. And how can I check in the construction of the next line, not whether it crosses the line.
Hopefully able to explain."
Uhm, it's still a bit cryptic. If I understand correctly, you'd like to use a sprite to procedurally draw a line from X to Y. And then draw another similar line, but have a collision test so that the program knows if the latter line cross the former line? Like in a Tron-style lights-bike game, or Snakes for that matter?

There is no actual drawing commands in AppGameKit, so you'd need to make your own, where you clone a given sprite as many times as necessary to reach from X to Y and place the clones along the line.

As for checking if two lines meet, you could either use the built in collision commands, which check to see if two sprites collide. In a Snakes/Light-Cycle game I'd rather use a 2D array to represent occupied tiles/pixels of the play-area. The array method makes such simple collision testing non-iterative thus saving a lot of CPU time.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 11th Nov 2011 18:15
Quote: "My graphic files are not divisible by 8 and they run fine on PC and iOS."


AGK will convert them to power of 2 internally (with a lot of wasted texture space), so making them power of 2 from the beginning will be more efficient.

Login to post a reply

Server time is: 2024-04-18 02:25:37
Your offset time is: 2024-04-18 02:25:37