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.

Newcomers AppGameKit Corner / Managing sprites, images and text

Author
Message
okee
9
Years of Service
User Offline
Joined: 1st May 2014
Location: Ireland
Posted: 12th Mar 2015 22:04
Hi new to AGK2 and getting to grips with it pretty quickly
Only issue I'm having is managing sprites or text

I'm used to a different method of coding
i.e. load images/sprites and then display them in the main loop

In agk2, images appear on screen once they are created
So i'm just wondering what is the best way to manage them ?

Do you create the sprites and then hide them and only make them visible
when you want them displayed on screen
or do you just load them as needed?
is there an overhead in loading them at certain times during a game

If anyone has a simple example, it'd be much appreciated
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 13th Mar 2015 09:38
Hi okee,

There is only a small overhead to creating and deleting sprites, I create my own particle systems which create a lot of sprites when needed and there is absolutely no noticeable slow down. I normally load all the media at the start for a relatively small game and then create sprites for each scene / menu / level as required.

On larger games I have loaded media for each level as needed but I think it's pretty unnecessary to do that unless you're using a lot of large images or sound files.

I store my images in a user friendly Used Defined Type (UDT). Something like this:


Using AppGameKit V2 Tier 1
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 13th Mar 2015 11:15
Quote: "I normally load all the media at the start for a relatively small game and then create sprites for each scene / menu / level as required."


This is exactly what I do... Load all the media up front, and then create/delete the sprites on the fly. Some of my larger levels have 2000+ sprites and the load time is a second or 2 tops...

Using AppGameKit V2 Tier 1
okee
9
Years of Service
User Offline
Joined: 1st May 2014
Location: Ireland
Posted: 15th Mar 2015 02:08
Yeah, that seems to make the most sense
Load all the data at start up and then create and delete sprites ion the fly.

Thanks guys

Login to post a reply

Server time is: 2024-03-29 02:31:36
Your offset time is: 2024-03-29 02:31:36