Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
How to use Game template ? — Gideros Forum

How to use Game template ?

lightlight Member
edited May 2015 in Game & application design
I m making a billiard 2d game using box2d . When all the balls are pockted i want give the option of restart or exit .
After googling around i found that Game template can do that easily , but i m not able to understand how should i implement it in my game ?

Comments

  • lightlight Member
    May be i m not understanding it because i m not aware of Scene manager and how it works.
    So going to understand the scene manager and its role in Game Template. [-O< Hope will figure it out .
  • lightlight Member
    edited May 2015
    Finally figure out how to implement the Game Template in my program .It is so simple if one understands the working of Scene Manager .
    Thanks @ar2rsawseen for making it .

  • lightlight Member
    edited May 2015
    Run into a problem , Once i select the level my game is loaded , but most of it is out of the screen , Changing the logical dimensions is not working , scaleMode change to stretch . But no change show my entire game, because of which i m not able to play , as buttons are off screen
  • Does that happen only in levels? If so you probably need to make some adjustments to your objects position to look right. Or maybe accidentally you place stage where it shouldnt be. (Check for stage:setPosition in your code)
  • lightlight Member
    edited May 2015
    @dreiko65
    No its just the first level i m working on , don't have more levels . But the image which i m using is of size 1199 * 686 , Earlier i had trouble displaying that image itself . So to make things work i change the Logical dimension of my program to 1280 * 800 , it displayed the image properly. And then i position everything with respect to that dimension. Look like i have selected wrong image. But nothing is clear
  • lightlight Member
    Logical Dimension of game template is 480*800
  • Can you upload your project or some excerpt maybe?
  • HolonistHolonist Member
    edited May 2015 Accepted Answer
    Did you alter the lines
    application:setLogicalDimensions(conf.width, conf.height)
    application:setScaleMode(conf.scaleMode)
    in main.lua?

    If so, please restore these lines.

    if you alter the resolution in your project properties, go to config.lua and change the lines
    --logical width of screen
    width = 480,
    --logical height of screen
    height = 800,
    so that the values reflect your resolution.

    Alternatively, change them to
    width = application:getContentWidth(),
    height = application:getContentHeight(),
    This will make it possible to change resolution of your project without adjusting anything else.


    edit: Just my opinion, but I don't recommend using the game template if you're a starter. It basically takes away the work of setting up your project every time, but you should at least once try to build it yourself. I'd also advise to write your own simple scene manager (it can be done in 10 lines of code or so), so you will get a feeling of how things work
  • lightlight Member
    @Holonist
    Yes i changed conf.width and conf.height , i choose the wrong number for width and Height as i thought my game is in landscape mode so width should be bigger than height ; but found that Gideros player just rotates the screen by 90 degree.

    Just simple thing took one and half day .
  • lightlight Member
    @Holonist
    And yes I will write my scene manager , because i was happy when my game worked but at the same time had the feeling that this code is not written by me .
    So yes i m going to , Thanks :)
Sign In or Register to comment.