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 / SetViewOffset & making a platform game

Author
Message
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 23rd Dec 2011 14:36
In a game like Sonic or iDork, is it feasible to build a whole gigantic level out of tiles (using sprites in the placement editor), and use SetViewOffset to scroll the viewport around the giant level?

Or are there better & less memory intensive ways to do this on mobile devices with AppGameKit?
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 23rd Dec 2011 20:18
You could always move the sprites yourself and when they are out of view you can reuse them on the other side of the screen. You store the map in an array and read from that as the player moves. Keeping track of the sprites might be a bit tricky though. Was really easy to do with paste sprite. Maybe it would be fast enough to simply delete sprites outside of view and then create new sprites as the player moves. I think that might be easier to code.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 23rd Dec 2011 22:02
Creating new screens on the fly is the other option I thought of, which would not be so tough on memory requirements. That would involve much sprite management though. A problem might pop up if the main character of the game is running fast (like Sonic). I don't know if AppGameKit can redraw so fast.

Any other options ?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 24th Dec 2011 11:35
I am using several hundred level sprites that are all controlled using a parallax scrolling system with no apparent slow down.

In this month's TGC newsletter (I hope) will be the first of a set of tutorials by me. The first one deals with view offsets and demonstrates a simple parallax effect that could easily be integrated into a new or existing game made in AppGameKit basic.

AGK deals very nicely with having hundreds and possibly thousands of sprites in play at once although I haven't tested the limits I know from experience that my larger levels have caused me no problems.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th Dec 2011 13:55
I have a game that uses sprite blocks and scrolling, all held in an array. I have a slow Android phone, and it is absolutely pants - 8FPS. So, I plan to implement hiding of offscreen sprites to see if it's any better, I'll let you know how I get on.

Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 24th Dec 2011 20:32
Batvink:
I would assume that offscreen sprites are handled well by AGK. I believe that you would earn more by reducing the amount of sprites. But do let us know what you find.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 24th Dec 2011 21:38
Baxslash, your game plays well on a pc or also on ios?

I have no problem with AppGameKit and putting thousands of sprites onscreen on windows. But on mobiles I'm afraid the story would look different...
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 25th Dec 2011 09:01
My game plays great on the iOS AppGameKit Player.

Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 25th Dec 2011 11:47
My only concern is phones with less modern hardware.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 25th Dec 2011 13:55
I can't say I'm afraid as I don't have anything else. We'll start to find out as more AppGameKit users start testing on multiple devices I guess.

Login to post a reply

Server time is: 2024-11-26 06:21:50
Your offset time is: 2024-11-26 06:21:50