Aphrodite's Recent Forum Activity

  • >

    > > hi,

    > > i want to know how can i do pause game with very tick

    > >

    > > explain :

    > >

    > > iam using every tick ---- set x of background to background.X-5

    > > but when i when to make pause (by set time scale to 0) the game is pause but the background stil move

    > >

    > > thanks

    > >

    >

    > if instead of doing set x of background to background.X-5, you do set x of background to background.X-5*60*dt, not only the pause will work, but also if the framerate takes a hit during gameplay, the speed of the background in pixels/sec will not be affected.

    >

    FANSTASTIC , EXCELLENT

    i dont know how to thank you

    that work ... and the "X-5*60*dt" save performance and optimisation on iphone 4

    now work fine and i solve my problem regarding iphone 4 (you remember in another post)

    the "*60*dt" to make something vary is pretty handy (most C2's behaviors use it without telling it):

    when you move something every tick by 5 pixels, it will move of 5 pixels every tick, if the game has slowdown, a tick isn't as fast as a framerate of 60 fps (where duration of a tick is 1/60 in that case).

    dt is the time between each tick in seconds, for instance, if you add dt to a variable every tick, it'll increase of 1 each seconds, regardless of the framerate (exception if the framerate goes below 10 fps, but having 10 fps would imply more problems of course anyway)

    adding 5*60*dt (=300*dt) means that at the end your tiled background each seconds will have travelled 300 pixels (5 pixels each 1/60 of seconds), regardless of the framerate

    As I stated, with the execption of physics, every behavior I think uses that without you knowing it (this explains that they ask for a speed in px/s, and acceleration in px/s², and so on..).

  • krish : I did not use google play yet, so I could be wrong on that, I just think I saw some people talking about setting minimum and maximum versions on the google play in other threads.

    As for the 4.0+, I misread, I thought you were talking about crosswalks (which is one of the Intel XDK possibilities).

    Sorry for not being really useful :/

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think Crosswalks is already 4.0+ only, also I think the minimum version required is more to set up on the marketplaces rather than the actual app

  • I have array who store object's UID's in cells. And i want make somethink like:

    int a = array [uid].variable

    How I can make that?

    I think the easiest way it to use(I use on start of layout and sprite as an exemple):

    Conditions;

    On start of layout; Sprite:Pick by unique ID: Array.At(x)

    Actions;

    Set global variable A to Sprite.variable

    The pick by uid will take the variable of that particular instance

  • If you want to stay with non 3rd Party plugin with construct 2, you can have a look to the system action "Set Layout Scale".

    To have it smooth, instead of setting it to a constant, you can set it to :

    When zooming In:clamp(LayoutScale+Scale_Speed, 0, Final_Scale) ; Scale_Speed being the speed of the zoom, and Final_Scale the value you want to have

    When zooming Out:clamp(LayoutScale-Scale_Speed, Final_Scale,LayoutScale) ; Scale_Speed being the speed of the zoom, and Final_Scale the value you want to have

    Just a suggestion thought

  • hi,

    i want to know how can i do pause game with very tick

    explain :

    iam using every tick ---- set x of background to background.X-5

    but when i when to make pause (by set time scale to 0) the game is pause but the background stil move

    thanks

    if instead of doing set x of background to background.X-5, you do set x of background to background.X-5*60*dt, not only the pause will work, but also if the framerate takes a hit during gameplay, the speed of the background in pixels/sec will not be affected.

  • I would guess it is because it is much simpler to do, like you can visually set the size and angle, also the values of each variables, it also forces you to set it, since it takes this instance you create as a reference (even in the editor itself, have only one instance of a sprite, change it's size, then add another one in the layout view: it is the same).

    Also I would guess the object type define more the reference of the identity, more than the actual settings of it.

    Anyway, I think it would be more trouble to have to set it without a visual representation anyway.

  • The thing is mostly I think you should preload them not all at once, only the needed ones firt, then the others

  • [quote:4nl0ykj4]As for memory management. Not all objects need loaded at the same time. store object data in arrays and create those objects as needed and destroy them as needed. Think of this like minecraft "chunks" You only need to load so many "chunks" at a time.

    Texture wise, they are still in memory, so it can be a pain.

    [quote:4nl0ykj4]An amazing feature construct should do instead of tiled backgrounds or sprites etc. Is procedurally/dynamically/viewpoint loaded objects. When the viewport is near where objects should be, load them and create them. Otherwise, they dont need to be loaded or known about until later.

    This looks like more something the user should have to do himself, that could break so many projects otherwise

  • You could also use the function object, have a function that return a value, then call it via function.call(functionname)

  • tgeorgemihai : method one is what we were using before the tilemap, method two is not a great idea memory wise, unless I did not understood it well

  • [quote:2ojkbp3k]Getting rid of objects outside layout will help (they normally are collision checked, and even if not because of collision cells, it still helps a little),

    What do you mean with that they are normally checked if outside layout, its standard that they are excluded if outside layout, or do you mean something else?

    I meant that even if they are outside the layout, they still exist, and C2 still register collisions with them from my experience. Which is normal, not every game can satisfy itself with a predefined layout size.(however, most likely the collision cells will filter that out).

Aphrodite's avatar

Aphrodite

Member since 20 Dec, 2011

Twitter
Aphrodite has 2 followers

Trophy Case

  • 12-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies