Help on pre-loading images

This forum is currently in read-only mode.
  • Hi all! Im making a space shooter game and I pre-load the background and split it up into many 256x256 canvases to save video memory. But I get a black screen when I put any layout before the layout that loads the images. I can�t figure out why this happens.

    The .cap file might be a bit messy, but I have the load command under "Arena" layout and under the group "initialize".

    http://dl.dropbox.com/u/18307664/SCII.zip

    Any help would be very appreciated :)

    /Segoi

  • Keep in mind using 4 256x256 canvases will not use any less video memory than using 1 512x512. It only helps if there is a large area of unused transparent space that enables you to use, for example, 3 256x256 textures instead.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Arima: Ok tnx, but I thought 256 worked better since I wanted to update the collision mask each tick, for some reason this was very slow if I didn't split the background.

  • A funny and simple bugfinding trick is to start deleting large parts of the events and check if the error is still there. If it's eliminated, delete smaller parts and check again, until you pinned down the event that causes the unwanted behavior.

    In this case I do blame linkman! :D

    Well, the "Setup following" action of the Magicam object apparently doesn't like it when you load stuff on start of layout, IF you set a lag. 0 lag will be fine.

    Apart from simply setting lag to 0, which you probably don't want, you can just push the "Setup following" action back. For example make it an action of event 9 where the condition is "Timer is equal to 4000" and place it right after you set the position for the player ship. Then it will work correctly.

    Why it does work when the layout is the first in line, might have to do with things going down differently on software startup.

    Other than that let me advice you to point out any custom effects and plugins you're using (or delete them from the project before you upload), because users interested in helping you might not bother to search the forum for the needed items.

    Good luck with that game (and please do discover the function object *hint*)!

  • Solved! :) Thanks alot PixelRebirth! You guided me to the problem. It was the paste into canvas that was the main problem. I solved it by giving it more time using the timer condition.

    Im a gfx artist and programming is something I forced myself to learn to make games :) But I'll look into this function object. Thanks for the tip.

    And sorry about the plugins, I totally forgot about that. hehe.

    /Segoi

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)