Sumyjkl's Forum Posts

  • I have been staring at my screen for a few hours now in disbelief at how enormously nonsensical the whole situation with text boxes is.

    First I found they steal mouse clicks, making an instance variable based "is focused" system totally impossible.

    Then I found they don't just steal focus for themselves, they steal focus for OTHER TEXT BOXES. So not even my ridiculous workaround that I thought would work, did.

    I really, really want to know. Is it actually possible, let alone plausible that one could ever find whether a text box is focused or not?

    Because seriously, it seems it would involve literal wizardry.

    Thank you, so goddamn much if you have anything whatsoever to help in my quest.

    TEXT BOXES NEED A GODDAMN "focus" BOOLEAN VARIABLE. NAO!

    /frustration

  • Probably best to do this:

    (Create a container with bat/eyes sprite)

    On bat eyes created  |  move to object bat (or other relative position)

                     |  pin to bat

    The problems I can see with your current method, for reference:

    ● [On collision with] triggers whenever something begins overlapping or is created overlapping another object, so it can happen multiple times (i.e. multiple bats can overlap and cause strange behavior)

    ● If the objects aren't in a container they can pick other instances. That is to say, bat1 can have bateyes2 pinned to it.

  • I've never used the multiplayer stuff before, but as for your first question:

    I take it your game works on the player(s) touching their player character to move it. If this is the case, the way to make it work for four people is pretty simple.

    For local multiplayer with multi-touch, you need:

    • A system to differentiate between several touches (keeping track of them)
    • A way to keep this tied with each player

    I always like to think that if you do everything with correct programming logic, and make any situation possible, most of these sort of difficult-looking things automatically happen. That is, if your game already differentiates between touches, you've got your game. Since the game can't differentiate between players (same device, and the device doesn't know who touched the screen) the only issue is keeping track of the touches and which character they belong to.

    In a bit more detail, you need the dragging and dropping part of the program to recognize the difference between touches.

    In pseudo code:

    on touch | store touch index in the object

    for each touch | do drag and drop events

    on release, find the object with the touch index that was released | reset the variable (e.g. to -1)

    Hope that helps. I don't have much experience with the touch behavior, but it should work.

  • Can you be more specific?

    If you follow this guide it may help.

    Edit:

    This is the system I usually use for menu buttons, if that is what you're asking:

    (reference is a text instance variable by the way)

  • You mean like this?

    https://www.scirra.com/forum/keep-momentum-and-same-time-ignore-input-while-jumping_t128458

    https://www.scirra.com/forum/how-do-i-disable-controls-input-while-jumping_t123872

    Edit: You might also want to decrease deceleration when doing this, else you'll slow down mid-air. That or decrease both deceleration (passive slowing for when you're not pressing movement keys) and acceleration (when you press keys).

    The trouble is, once you take this method you'll need to set a variable to reset to (unless this is the only time you use acceleration and deceleration).

  • Is there some other part of the project that changes that variable?

    Edit: sample capx http://www.mediafire.com/download/d70kn ... utton.capx

  • Berserky

    Not usually, but I don't think anyone actually knows why any more. Now that we have notifications on almost every forum in existence, it shouldn't matter.

    I would actually really like to see someone make something interesting with this. The limitations are such that it's totally useless as actual 3D (no textures or even colors for that matter) but it might make for some interesting project at some point.

    If you or anyone else makes a project I'd love to see what it's like.

  • Pretty sure it's in there. It's a system value.

  • Oops, sorry, I misunderstood I think.

    I'm pretty sure the existence of multiple images in a sprite can affect memory usage, but I'm not sure if canvas2d optimizes this by leaving unused animations out of storage. It might be best to test this. Maybe use both types in extreme amounts and see what the difference is in memory use. Node Webkit is likely best for this, since browsers are not exactly stable.

    Other post:

    Not sure how canvas2d does it's thing, and I don't know much about the technical side of memory to begin with, but speaking logically; If the single sprite contains less data than the many, it's probably more effective. If it contains the same amount of data, it's less effective in principle, since the location and other information has to be stored about the object, not just the image. Transparency also causes much more of an impact in CPU usage on several overlapping sprites than on one sprite. My advice is that if it's plausible and a one off thing and the sprites would always be together, (the individual sprites aren't used in different configurations or anything) then it might be best to optimize there, and make it one sprite. If it recurs enough and often enough that all these sprites have to move in unison, it's probably best to optimize it as above.

  • Unfortunately I can't open your project, but I'm guessing you mean something like this:

    x = int(object.X/32)*32

    The above will set object to the closest multiple of 32.

    The idea here is that the value, object.X will be divided by the grid size you want, and then rounded up/down or in this case to the closest whole number, then multiplied by the grid size again to get it back to it's proper size. In effect, it rounds to the grid size, since when int() is applied to it at a 32nd the size, it's rounding to 32x the normal size. Or something.

  • Seems to work fine for me. What part didn't work?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I used this tutorial: http://yal.cc/hosting-html5-games-on-google-drive/

    And it seemed to work. I think the key is that it has to use the different domain name; googledrive.com, not drive.google.com.

  • Ah good point. Thanks for the tip.

  • I've seen a few topics on the forum marked as popular because the author has replied 50+ times to keep it up the top of the list. In most forums this is spamming, and in some just double-posting is looked down upon. Isn't there some kind of rule for this?

    I don't see anything but the slightly ambiguous word 'spam' in the rather hard to find rules. But common sense and a good idea of what ethics means in most cases makes rules redundant. I'm not trying to be a backseat moderator here, but under my own type of totalitarian rule I'd just merge all the posts into one, and for massively obtrusive repeat offenses lock the thread and warn the user. This kind of stuff can get out of hand, and in the meantime it makes a mockery of the forum's 'most recently replied to thread first' system. It's logically in the same boat as trolling and flame-baiting.

  • Arrays are broken.

    http://i.imgur.com/HOT708n.png?1

    http://i.imgur.com/Pyr3wrI.png

    Turns out, the array needed to be larger than the scope. The array width, height etc. are not zero based. They are the count of the number of entries on that dimension.

    If your array height is 7, try making it 8.

    This worked:

    The capx I used: [mediafire]