boolean's Recent Forum Activity

  • Hi all

    I might be a moment of stupidity but I'm trying to figure out how to do the following: (this is just sample code):

    if((a==b) || (b==c && c==a)) {

    MoveSprite();

    }

    I tried doing this in C2 - here is a screenshot:

    <img src="http://i.imgur.com/D5Chp.png" border="0" />

    which is actually the equivalent of:

    if(a==b){

    MoveSprite();

    }

    if (b==c && c==a){

    MoveSprite();

    }

    The problem is that now when a==b and c==a, C2 fires on both conditions, as opposed to my one condition in the sample code. What I want to do is say "if the first condition block OR the second condition block", but since I can only do OR statements on single condition blocks it doesn't cover both cases.

    Ideally I would want to do something like this:

    <img src="http://i.imgur.com/33pMJ.png" border="0" />

    Is there a way of achieving this? I feel like I must be missing something obvious or else people like Arima with their 10 bazillion event super-games would have run into this a while ago <img src="smileys/smiley17.gif" border="0" align="middle" />

  • Does C2 use .NET at all? From what I understand the whole thing is in C++? The only things I could find online pointed to a corrupt .NET install, but that seems like it should be unrelated.

  • Are you using any plugins? If you happen to be using r0j0hounds canvas plugin you need to disable WebGL. Otherwise on anything larger than around 800x600 you'll start to see your fps drop by half.

  • I would pay another $100 for a debugger...yet since the preview mode runs outside of C2 in the browser I can't see any way of getting it to work without having something like

    Subscribe to Construct videos now

    running (I'm linking to YouTube as his site seems to be down).

    Maybe we don't need a full blown debugger with the ability to step through code (inside C2 I mean). Maybe we could get an extension to preview.js that has clearer list of all the objects and their values, as well as a simpler overview of where the program is currently pointing. I could live with not being able to step through my code if I could just add "runtime.sprite.player[0].X" to the Chrome watch window and see what the current value is. I'm sure something like that is possible now, but you have to wade through some pretty large objects to do it. The irony is we all keep asking for a debugger - we already have a debugger in our browsers, we just need a easier way to make sense of the data. Maybe that is a more realistic goal?

    You could also make your own 'debugger messages' by putting a text object on a layer and appending the text via an action.

    For those who might not have seen it yet, I highly recommend using the Chrome logger by wgfunstorm. It lets you spit out data and even arrays into the chrome console tab. Immensely helpful. (Note: I'm linking to the version I added array logging to - The regular version wgfunstorm is missing some files in the zip and he hasn't been on in a while to fix it).

  • Interesting, I hadn't thought of that.

    Based on this, I wondered if this a problem with any platformer. I loaded up some flash platformers and was able to replicate this problem. I also wondered perhaps this could be replicated in old Nintendo games? Especially games with quite floaty characters like Super Metroid.

    I went and watched some videos of a few SNES games and it's funny how rare they have two platforms of the same height next to each other. They always seem to be 32 pixels up or down. Sneaky <img src="smileys/smiley1.gif" border="0" align="middle" />

    I came to the same conclusion you did by setting the gravity higher, but I found it also changes the jump arc quite a bit. I'll play with the settings a bit more and see how it goes but I think I'll also update my level design a bit to try and avoid small gaps like this.

    Thanks for the responses. Discovering little design issues like this, even in old games, I always find fascinating.

  • I've been meaning to mention this for a while now. I vote with all my votes.

  • Hi all

    I found an odd behaviour today that I was able to recreate in the sample platformer in C2.

    Basically what happens is that, given a small enough gap, a player running over the gap without jumping hits the opposite edge and travels downwards - but then pops back up and continues on the floor.

    Sample Capx

    To see this in action, just run right. The player should bounce back up and continue on, despite the bottom edge of the box actually catching. One quick fix is to crank the gravity up for the player, but that also affects his jump arcs.

    Has anyone ever noticed this before? Is this an issue with Construct or something more fundamental to programming?

  • Make sure you CUT and paste the global variables into the layout you want. C2 will still give you a warning that it will delete the events, but once you paste them in the events are un-deleted.

  • If you placed 20000x768 sprites, maybe, but scaling sprites incure no extra resources (see the reply by Ashley) so you can just take one sprite and stretch is halfway across the level. Then you can place your individual odd shaped sprites where needed.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I hope uneven grounds will be implemented in future releases. The problem is that when I create a tiledbackground with a ground graphic for the whole level (4000x768 for example) and I change its behavior to solid. The player sprite collides with the transparent, empty space of the tiledbackground. The engine should be able to recognize if the part of the tiledbackgrund is transparent or has actual graphics.

    From what I understand this would mean wrapping every repeated tile (possibly thousands) in their own bounding box - somewhat defeating the purpose of using tiles in the first place. Imagine you had a circle bounding box on a tile - It would be very hard if not impossible for C2 to keep one large circle bounding box over all the tiles once they have been stretched over an area into a rectangle. If you are detecting based on transparency, now you are doing per-pixel checking every frame - much more resource intensive than the bounding boxes C2 uses.

    I suggest creating two layers - A collision layer using sprites (giving you access to any weird shapes, plus sprites can be stretched to cover any area) and then a second layer with all your graphics/scenery on top.

  • Working fine in Chrome for me too. Try pressing CTRL+0 on your keyboard - this will reset the zoom level in Chrome. I noticed that I could get some gaps to appear if I zoomed in.

    The only other way I could get gaps to appear is when I shrunk my window down to around 400x200 (not sure if this is related to the size of the sprites or a rounding error with the pixels) - Are you testing this on a mobile device or a desktop?

    (By the way, cool game. Not sure where the music is from but it's very catchy <img src="smileys/smiley1.gif" border="0" align="middle" />)

  • There is also an "Overlapping at offset" condition. You could add this in and say "If at 4 or -4" to check a few pixels to the left or right. This way when the player runs into the solid you are actually checking a few pixels past the payer.

    More info on this in the manual

boolean's avatar

boolean

Member since 22 Aug, 2012

None one is following boolean yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies