Forums

OverviewV-Play 1 Support › How to make a level bigger than the GameWindow?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #7155

    Arend

    Hi all,

    I’ve been going through the tutorials, but there’s one thing that’s not quite clear to me yet. As far as I can see, all the tutorial games have a single scene which through scaling fits nicely with the game window. Other than that, the scenes are pretty static. However, for the game I want to create I want to have large levels, of which only a small part would be visible at the same time. A player character would walk around, revealing parts of the level as he goes. A good example of another game that works like that are the old Zelda games with a top-down view.

    From what I saw, the Chicken Outbreak demo at least shows that scenes don’t have to be entirely static. But I’m still not sure how I would achieve the possibility of having large levels with V-Play, with scrolling along both axis on an as-needed basis. If anyone could give some advice on how to approach this it would be greatly appreciated :)

    Thanks!

    #7163

    Arend

    Just to post a little update with what I’ve discovered so far… it seems I can make a little progress by disabling the automatic scaling by setting scaleMode to “zoomNone”. From there I can apply custom transforms like Scale and Translate to the Scene which I think can help me to achieve what I want, but it does seem like quite some added complexity, and I’m not sure if this is an appropriate solution with regards to rendering optimizations. If anyone has experience with these kind of solutions, I’d love to hear it!

    • This reply was modified 4 years, 8 months ago by  arendjr.
    #7168

    Alex
    V-Play Team

    Hi,

    the scene is more or less the visible part of your game. As you already mentioned Chicken Outbreak, the level IS in fact bigger than the scene and scrolls past it. The platforms get created outside of the visible area and also get destroyed after they leave the screen.

    So your level item inside your scene can have any size you like, the scene (gamewindow) dimension only defines which part of the level is visible.

    Short example:

    GameWindow {
      Scene {
        width: 480
        height: 320
    
        Level {
          // make the level bigger then the scene
          // only the upper left corner of the level will be visible in the scene
          width: 3000
          height: 3000
        }
      }
    }

    Now you only need to add a behavior to move the level in the scene. Possibilities would be wrapping the level with a Flickable item, so the user can scroll around freely. Or programmatically change the x and y value of the level, e.g. depending on the character movement. In Zelda, the character is always centered in the screen, you can achieve this by ONLY moving the level.

    I hope this is what you were looking for.

    Cheers,
    Alex

    #7169

    Arend

    Ha, yes, that was exactly what I was looking for! I already had a feeling I was overcomplicating it for myself… :)

    Thanks a lot!

Viewing 4 posts - 1 through 4 (of 4 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support