dop2000's Forum Posts

  • Ok, then do this -

    Add Timer behavior to building.

    When Building is created, start a recurring timer "AddOil".

    On "AddOil" timer event, add 1 to Oil.

    Timer is a much better option here than using "Every X second" or "Wait".

    In "On timer" event you can do different checks - say, if building is upgraded, you can add 2 oil. Or you can stop the timer when player pauses the game etc.

  • Have you read any of the tutorials?

    MoveTo is the easiest part, just do "Move to (x,y)".

    But before that you need to check if the destination tile is unlocked and get its coordinates. All this you can find in the tutorials.

  • You can simply add Building.count

    It's the number of Building instances in your game.

  • If you use Physics only for gravity and bouncing off solids, you can do the same with Bullet.

    You can mix Physics with other behaviors as long as they are not both enabled at the same time.

    Say, on mouse click you disable Physics and enable Drag&Drop. On mouse release you disable Drag&Drop and re-enable Physics.

  • You do not have permission to view this post

  • It's not jumping across tiles on the video, is it?

    To move player sprite smoothly from one tile to another use one of the movement behaviors - the best and easiest to use is MoveTo.

    You can also do it without any behaviors, simply moving a couple of pixels on every tick:

    Player-> Move 1px at angle (angle(self.x, self.y, destinationX, destinationY))

  • I meant like this:

    https://youtu.be/pUvevR16qlU?t=7m52s

    Skip to 7:50

    It looks like the player is moving freely, but in fact it moves from one tile to another.

    This will be much easier to make. There are lots of tutorials about this:

    https://www.scirra.com/tutorials/all

  • I haven't tried it, but maybe this plugin will help:

    If not, scrolling with events may be difficult as different browsers render text differently.

    Also, if you are making an RPG with lots of lines of dialog, hard-coding lines of text into events is a bad idea. There are few tutorials on how to make dialogs properly in FAQ.

    Here is one example that uses XML file to store dialog options:

    (Working link to capx file in comments)

  • You can try the same principle as you did with the sprite box to limit player movement. Only instead of BBoxTop, BBoxLeft etc. use coordinates of this tile edges. It will be a bit trickier though.

    You can use PositionToTileX(player.x) and PositionToTileY(player.x) to get tile coordinate.

    Then add event Compare Tile State to see if this tile is "unlocked" and player can move inside it.

    https://www.scirra.com/manual/172/tilemap

    Are you sure you want the player to move freely inside the tiles with 8-behavior?

    If you only allow movement from one tile center to another (like in most grid-based games), this will be much easier to do:

    Player presses Left button, you check if the sprite on the left is unlocked and use MoveTo behavior to move player sprite there.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here is an example of Zelda-style dialog which uses XML file to store dialog lines:

    (there is a working link to capx in comments)

  • Yeah, try not to mix Physics with other behaviors like Platform, Bullet, 8-Direction etc. You also should only move Physics objects using Physics actions (apply force, impulse, velocity etc.), don't just change their position or angle directly.

    All these things are not strictly forbidden, but if you mix physics and non-physics, the object may behave in unexpected way, interact with other objects incorrectly etc.

    That being said, there is an example of physics platformer game on youtube. Nobody knows how it's done, maybe it's a clever mix of both behaviors, or the author made his own platform engine with physics. We discussed it here:

    EDIT: All of the above applies to Chipmunk too.

  • "Else" should be at the same level as the condition (Button var=0) and there should be no other events between them.

    You can select the condition and press X, this will create an Else event for it.

  • I told you how in my previous comment - either with a global variable or with Timer on a global object.

    Create a sprite, set "Global=yes", put it off-screen on level 1, add Timer behavior, start timer for 6000 seconds.

    You'll have much better chances to get help if you post your code here, preferably capx.

  • How did you do the timer for each level? Why can't you use the same method for 10 levels?

    You can create a global variable StartTime, set it to time on start of level 1, and add this event:

    Compare global variable StartTime<(time-6000) -> (game over)

    The problem with using global variable is that you'll have to adjust its value when player pauses the game.

    Or you can start a timer for 6000 seconds on some global object. Timer is a better option.

  • Simply remove the condition "On every tick" from event #2, but keep the event itself.

    So in your event #2 you should have an empty box on the left and "System Set..." action on the right.