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 / Scaling/Flipping/Zooming - any advice

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Sep 2011 16:18
Anyone have any experience with flipped, scaled, physics-enabled sprites? I'm about to get to this bit and anticipating some issues along the way. I will be scaling then flipping then adding physics collision, automatically calculated by AGK. Does anyone if there is a right way and a wrong way to do this? I understand the commands, just need to know if there are any glitches.

Also wondering if anyone has messed with scaling the view? I need to zoom in, in the style of the original Lunar Lander, my plan was to replace the sprites and rebuild the screen. Now I see that I can zoom the viewport but don't know if this is the best way to deal with it. I would really need to use over-sized images and a <0 scale for most of the game, to get good images when zoomed in (or zoomed to 1.0). There may be memory/performance issues, I have a gridded landscape of 48x8 sprites.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Sep 2011 19:52
The answer to the first part is, flipped and scaled sprites do just fine when making them physics-enabled.

Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 17th Sep 2011 22:29
I tried to rotate sprites with physics on, it also rotated the physics, so all got odd. A bar tried to balance itself at 45 degrees, instead of falling to the ground because the sprite was rotated 45 degrees.

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 18th Sep 2011 01:26 Edited at: 18th Sep 2011 01:46
I'll be scaling spaceships for a 2.5d space shooter I'm working on, but it won't have physics on.
I'm hard coding the shot damage and collisions for the ships from the minimap data. (at least, that's the plan man)
I have not played with scaling yet, but it seems that 1 is 100% and 2 is 200% original size.
I am hoping that the scale value is a float.
I'll let you know if I run into any problems (glitches) or if I figure any tricks out.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 18th Sep 2011 17:06
1. SetPhysics OFF for sprite

2. Manually Rotate your sprite

3. SetPhysics ON for sprite
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 18th Sep 2011 20:09 Edited at: 18th Sep 2011 20:27
A quick note on scaling, not that I have messed with it a lot yet. Remember there is a setspritesize command as well, so you can actually use the pixel sizes rather than a percentage.
I've yet to play with the physics, but have had an idea to try since before AppGameKit was released. So I will be using it,(or trying to) soon enough.

Scaling the whole screen I have not tried, however as long as you don't scale it too much, AppGameKit does a good job of keeping image quality up. In my shooter project I scaled up the first end boss 2x and it still looked good. I was expecting it to look quite pixelated.
I would imagine the best way for you to go is to make your main level as large as it needs to be, say 4 screens long by 2 screens high for instance. Then just scale your viewport when needed, as you scroll around it. I haven't tried anything like this yet but that's how I would attempt it to begin with.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 18th Sep 2011 20:32
scaling looks REALLY GOOD in agk.
anyone knows what kind of algorithm is that?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Sep 2011 21:56
I've found that scaling down isn't so good. My screen turned into a few specks of partially linked white dots.

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 23rd Sep 2011 06:19
No I would imagine it would lose some detail especially on lines as you are using. Can you scale it up for when you are close and scale it down to min 1x when you are further away?

Login to post a reply

Server time is: 2024-04-20 04:59:58
Your offset time is: 2024-04-20 04:59:58