LittleStain's Forum Posts

  • I usually work with ViewportLeft, ViewportRight, ViewportTop, ViewportBottom for these kind of things.

    Easiest if the sprite has it's origin in the topleft-corner.

    on start of layout

    sprite set width = viewportright(q) - viewportleft(q)

    sprite set height = viewportbottom(q) - viewporttop(q)

    sprite set position = x= ViewportLeft(q), y= Viewporttop(q)

    if the sprite has it's origin in the center : x= Viewportleft(q)+0.5*(viewportright(q)-viewportleft(q)) , y= Viewporttop(q)+0.5*(viewportbottom(q)-viewporttop(q))

    where q is the name or the number of the layer on which the sprite is

  • From the manual:

    https://www.scirra.com/manual/88/anchor

    Objects using the Anchor behavior should also be placed on a layer with its parallax set to 0, 0. Otherwise as the game scrolls the objects may "lag" behind the screen.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • How about something like...

    https://dl.dropboxusercontent.com/u/143636437/examples%20for%20web/fishy%20drag%20and%20drop%20offset%20example.capx

    I find this reaction very offsetting...

  • I was thinking along the lines of making all guns different animations of the same gun-sprite.

    That way an instance variable would be used to determine which gun to display and how the gun works.

    gun if instance variable = bazooka

    fire Very big bullet

    You could also use a boolean variable InUse set to true when the player is holding it and to false when it's on the floor.

  • This tutorial should explain a lot :

    https://www.scirra.com/tutorials/73/sup ... reen-sizes

  • You can always set the angle of the sprite in events, so you could also choose to set the angle of the sprite to be the same as the angle of the bullet motion through events.

  • This would allow a deviation of 6 degrees per second, but is one way to do it:

    every 0.1 seconds - bullet set angle of motion = clamp(angle(bullet.x,bullet.y,target.x,target.y), bullet.Bullet.AngleOfMotion-1, bullet.Bullet.AngleOfMotion+1)

  • So you mean that map is loaded live from the openstreetmap.org server in its own layer and you made your interactive data in a seperate layer in construct2 as an overlay?

    Am I getting that right? That looks pretty slick I must admit.

    Dank je wel trouwens

    Yep that's about it..

    The markers on the map itself are part of the plugin, but controllable from within Construct (Appearance/placement)

    They are updated every minute to reflect if the pubs are open or not (using the system time of the device running the "Game")

    Because the map is a DOM-element C2 can't really overlay it (unless you use a div/html-plugin), so I just played with animating the size of the map to uncover the menu's and stuff..

    It took quite some experimenting to get it to work and look right (especially because I wanted it to work on every screensize, mobile, tablet and desktop), but I'm quite happy with the result.

  • I've once made an interactive map with C2 showing in realtime which pubs were open in my hometown..

    I used the Openstreetmap.org maps for it. Dragging etcetera was done through the original leaflet.js.

    I had to adjust a plugin a bit to get it to work, but the effect was pretty nice.

    WatIsOpen

    should work on mobile as well as desktop.

  • Should be something like this:

    Create a global variable DiceRoll

    Add the function object to your game

    triggered event (on sprite clicked?)

    • system set variable DiceRoll = int(random(1,111))
    • Function call "DiceAction" with parameter0 DiceRoll

    on function "DiceAction"

    • Function if parameter0 is < 50

    > (add the action you'd like)

    • Function if parameter0 > 49
    • Function if parameter0 < 100

    > (add the action you'd like)

    • Function if parameter0 > 100

    > (add the action you'd like)

  • It would probably be better to create a sprite on left button pushed give it the drag and drop behaviour and pin it to the map so you can drag the map while mouse down.The visual effect would be the same as dragging the viewport over the layout, but ofcourse it could give other issues, depending on the needs of your game.

  • If you could first explain what you expect with a dice roll, it might be easier to tell you how to do it..

    The above comments explain how to get a random number.

    Once you get the random number you can compare it and attach the actions you'd like to set.

    What part are you having trouble with or was your initial question misunderstood?

  • You can just drag them there to make them subevents of the group..

  • I think you are confusing turning on collisions with solid behaviour.

    Collision is only for detection-purposes, without solid behaviour the character will go right through..

    Thanks for the ninjaaaaing