ravelin's Forum Posts

  • 13 posts
  • Thanks, this looks like what I want! I actually remember looking at this example before, but I completely forgot about it.

  • I am trying make a game that integrates level rotation into a 2D platformer setting, where you actually rotate the level in order to solve it. Very similar to And Yet It Moves.

    I have a basic platformer layout with the camera set to Scroll To the player, and found the system action to "Set Layout Angle". This seems to work (although it is an instant transition and I'd rather have it visibly rotate), except that it breaks the ScollTo behavior (once the layout is rotated, the camera no longer follows the player).

    Does anyone have any experience/ideas about implementing this type of mechanic in Construct 2?

  • For anyone interested, here is what I worked out:

    drive.google.com/file/d/0B1keSNvq9c4JbjhBTTd6YUhwbHc/edit

    Zatyka, I did find an example of tile based movement in the FAQs, but it did not animate the movement, it just "teleported". If I missed another one that goes over this, I apologize.

    I did eventually find this example via search, but decided to come up with my own solution: scirra.com/forum/final-fantasy-example_topic78390.html

  • Hi Plinkie,

    Thanks for taking a look!

    Unfortunately this is not quite what I'm looking for. You've got the pixel by pixel bit, but not the 16x16 tile-based bit.

    Let me try describing what I'm looking for another way.

    You can think of this background map as consisting entirely of 16x16px tiles, which are fit together to make a map. They used to do this because it allowed them to reuse specific "tiles" in the same map, and save space on old game cartridges.

    The player sprite is also 16x16px, and so takes up the same space as one tile.

    What I am looking for is when the user presses a direction on the keyboard (this can be just a tap), the player sprite will move from one tile to the tile adjacent in the direction pressed, but also for the movement to be shown, instead of just teleporting from one tile to the next.

    It is very important to me that the player always end up on one of these 16x16 tiles. With the pixel by pixel movement in your example, the player sprite could end up with 8 pixels on one tile, and 8 pixels on another (essentially putting them between tiles).

  • Hello!

    I am working on a simple "Arena" style rpg game with tile based movement, a-la Final Fantasy 1-6 (you may noticed the sprites are borrowed from Final Fantasy IV from Squaresoft).

    The first step is to make a map movement system! I have something basic worked out, but right now my character just jumps from one tile to the next.

    How do I change the movement mechanic so that the player character actually moves smoothly pixel by pixel from one 16x16 tile to the next? I do want to recreate the classic such that the player can only end within the specific 16x16 tiles (not half in one tile, and half in the other).

    Any ideas? Here is what I have so far: drive.google.com/file/d/0B1keSNvq9c4JNjc2VE1MamNPdVk/edit

  • Great! So, I've eliminated the old modulo, and implemented something similar to what R0J0hound suggested instead, but I am having the problem of little gaps between each platform block.

    I have constant 60fps, and the speed definitely does not exceed 1920 pixels per second.

    Also, I noticed the gap varies a little with a bit of a display stutter, so I imagine it wouldn't scale well with older machines?

    I'm posting the project file in case anyone wants to have a look. I'm doing this for fun and education, so I welcome any comments, thoughts, (constructive) criticisms, or alternative approaches.

    docs.google.com/file/d/0B1keSNvq9c4JZHFKTnhEQ1gxQ28/edit

  • Awesome response R0J0hound, thanks for taking the time.

    I'm actually glad to find out that it was me after all, because that means I can learn something!

    I guess I'm so used to thinking of calculators as computers, that I expected expressions in Construct to evaluate as they do on my calculator.

    I'll play around with your suggestions and let you know how it turns out in case any one else is interested in doing a project like this.

  • Thanks Ashley. Still learning, sorry for taking up your time.

  • More information/context is available in /topic78529 in case it is helpful.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't think I can use timing for what I am trying to do. I am following this guide to create an endless runner:

    http://

    gamedev.tutsplus.com/tutorials/from-scratch/build-a-canabalt-style-infinite-runner-from-scratch/

    In this case, we are using this expression to know exactly when we need to create a new platform object, which are 32 pixels wide each, and taking into consideration a speed variable which increments as the game progresses.

    If this can be done using timing in seconds, rather than ticks, it is a little beyond me, but I would be thrilled if someone knew of a way to do that, and could explain it.

  • Link to .capx file (required!):

    I'm not allowed to post links so I will try breaking the link up so it is not recognized.

    https://

    docs.google.com/file/d/0B1keSNvq9c4JZ3VYVFJTZlU4WUE/edit?usp=sharing

    Steps to reproduce:

    1. run project in debug mode

    2. notice that module expression (which outputs to the modulo variable every tick) evaluates incorrectly.

    Observed result:

    416%(32/5) evaluates to 6.4

    Expected result:

    416%(32/5) evaluates to 0

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack:

    Windows 7 Ultimate 64-bit SP1

    Construct 2 version:

    Release 146 (64-bit/Steam)

  • Dang. I was hoping it was my fault.

  • Hi everyone! I have a weird behavior which I don't understand and I'm hoping someone can help.

    Hopefully I'm just doing something stupid.

    I have an expression which doesn't seem to be evaluating correctly, which leads me to think I've written the expression wrong or something, but I can't see how.

    The expression:

    TickCount % (32/speed)

    Or in words, the remainder of TickCount divided by (the result of 32 divided by the speed).

    Where TickCount is the variable representing the current tick number, and speed is a variable used in a game I am making.

    When that equals 0, I want to do a thing.

    I have a specific case where that expression should be evaluating to zero, but is not.

    Example:

    TickCount = 416

    speed = 5

    so:

    416 % (32/5) = 0

    Unless I'm crazy, that is true, it evaluates to zero, but my program isn't doing it's thing.

    So, I had it also output the result of that expression to a global variable every tick I can monitor in debug, and it claims to be evaluating to 5.399999999999977 at tick 416 with speed 5.

    I am baffled by this. Any help would be appreciated! It's a bit of a pain for me to post the actual project for people to poke around in, so I'm hoping the answer is obvious from the above, but if not, let me know and I can try to find a way to share the project.

  • 13 posts