TiAm's Forum Posts

  • v0.2 now released. See original post for download and changelog.

  • TON14:

    Glad that works for you. The pointer should move with the sprite the way I suggested; I think most people would prefer that kind of functionality. However, I have what you are talking about -- scrolling affects pointer position -- on the todo already, as part of the bounding options.

  • TON14

    1. Cannot disable ESC as exit in browsers. This is a safety feature built into the API itself. Don't use ESC for other things in-game.

    2. Sloppy testing on my part. Apparently, node-webkit doesn't use ESC to exit. I'll manually add this functionality for v0.2. Thanks for the heads up!

    3. On Object Clicked and Object Touched are functions of the mouse and touch plugins respectively. They won't work because they are looking for the position of the mouse cursor, which is hidden and locked to the center of the screen.

    To accomplish 'On Object Clicked', use a combination of 'On Click(Left,Right,Any)' and 'Is PointerSprite overlapping Foobar'. On object touched is a little trickier, as this plugin is not really intended for a touchscreen interface.

    3a. I'm sorry, but I don't know anything about this plugin. However, it probably doesn't work for the same reason as On Object Clicked and On Object Touched; these conditions use the position of the mouse cursor, not the raw mouse movement. However, I'm sure a drag and drop functionality could be achieved with events.

    ---------------------

    Finally, on bounding: Yes, right now the only option is bound to window. There will be more options come V0.3. However, there's an easy fix for your problem: instead of setting your pointer sprite to MouselockX/Y, set it to the following:

    Set X: CanvasToLayerX(SpriteLayer, MouseLock.MouseLockX, MouseLock.MouseLockY)

    Set Y: CanvasToLayerY(SpriteLayer, MouseLock.MouseLockX, MouseLock.MouseLockY)

    Hope that helps!

    Tim

    P.S.

    v0.2 coming very soon...

  • Note: v0.3 does not minify correctly. v0.5, despite the version increase, merely fixes this minify glitch. Grab 0.3 for test capx and documentation. Will update the rest of the page when I roll in some real changes (response curves). Link to 0.5 plugin below:

    Download Mouse Lock v0.5 (Plugin Only)

    Version 0.3

    :

    v0.3 Changelog

    Download Mouse Lock v0.3

    Mouse Lock:

    This my first -- <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy"> -- c2 plugin, Mouse Lock v0.3:

    This plugin lets you lock the cursor. That's about it. However, I'm making an attempt to complicate this plugin beyond all reason. <img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked">

    Some info:

    It works in Firefox and Chrome. Other browsers are NOT supported.

    When activated, your normal cursor disappears. Press ESC to get it back.

    When cursor is locked, the normal mouse plugin x/y readouts won't work <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad"> . However, clicks and mouse wheelies still work. So, you may want to use this with the mouse/touch plugin(s), as opposed to by itself.

    Released under Creative Commons Attribution 4.0 International license. Basically, do what you want with the plugin, but if you do modify it, just make it clear it's a fork, and not one of my versions. <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    What's working (

    I hope

    ):

    1. Pointer lock should work for firefox and chrome. Again: will not work in any other browsers.

    2. Can get Raw values(X/Y) which indicate movement change per tick. No settings affect raw except for 'Disable if Unlocked', which disables getting raw x/y or MouseLock x/y readout (you can still see them under debug, but their expressions return an impossible value).

    3. Can get MouseLock values(X/Y). For now, this bounds the cursor to the current window size. This value is also affected by Cursor Speed, Deadzone, Speed Cap, and Invert(X/Y).

    4. Can enable/disable pointer lock programatically... <img src="{SMILIES_PATH}/icon_e_ugeek.gif" alt=":ugeek:" title="Uber Geek"> ...er, in other words, you can lock/unlock with events (the SetMouseLock action). HOWEVER, the initial lock request must be activated by a button or click (for now, your options are a single or double click; custom key isn't implemented yet). Once that's done, you can use events to lock/unlock to your hearts content.

    5. Bounding now works. Can bound to window, layout, or be unbounded. See changelog for details.

    What's not done:

    1. Smoothing will eventually add an option to smooth the cursor (for example, if you are moving the cursor fast and suddenly stop, it would take a few tick to slow down).

    2. Response Curve. This will allow linear or curved. In other words:

    if your response curve is 1.0, your curve is linear(no difference.)

    if you have a negative curve (< 1.0), your sensitivity will be less when moving your cursor slowly (lets you make fine adjustments).

    if positive, your sensitivity (> 1.0) slows as you move it faster (let you move your mouse rapidly with small movements, without larger movements hitting speed cap or moving too far)

    More Info on Pointer Lock API:

    API Info on MDN: https://developer.mozilla.org/en-US/doc ... inter_Lock

    Specification (Currently, working draft): https://dvcs.w3.org/hg/pointerlock/raw- ... index.html

    Plugin Download:

    Contains plugin, readme, and test capx (r168 or later).

    Download Mouse Lock v0.5 (Plugin Only)

    Mouse Lock v0.3(FIXED)

    Final Words:

    Hope this is useful for someone. I made it for my WIP space shooter, because I kept clicking outside of the screen during gameplay. <img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarrassed"> Suggestions are welcome.

    Cheers,

    Tim

  • Actually, aac and ogg are ABX transparent at 160-192kbps for the vast majority of content.

    Certain sounds can be very demanding on encoders -- eg. clapping is something of a torture test. Also, some synthesized sounds have very complex harmonics that can be smeared even at high bitrates.

    If you find yourself having a problem, you can still manually encode, then import into construct. Sometimes custom encoding flags can improve quality for a troublesome sample. Google's your friend. Just remember: aac and ogg are both superior to mp3 in quality; in many cases near-transparency can be achieved at 128kbps.

  • QuaziGNRLnose

    Thanks, that looks like it'll work fine. I'm just starting to learn javascript; I didn't know it had math functions like atan built in. Guess I have a bit to learn...

    rexrainbow

    I could do that...but I'd be worried that it might break later on. If it's not a documented part of the sdk, there's no guarantee on fixed syntax, right? Or, maybe I'm worrying too much.

  • Is there is an equivalent to the angle(x1,y1,x2,y2) expression built into the sdk? Trivial to do manually I guess, but if there's an internal command, I'd rather use it.

  • Yeah, I've had to do that before. On the whole it saves time, but occasionally it gets in the way. Still, I'd love to see this for groups and maybe layers. Functions...I don't know how that would work the way functions are now.

  • Is overlapping isn't necessarily faster than on collision, but I've found it to seem less prone to causing jank when you have a lot going on. I use it 95 percent of the time.

    On distance: seems like one of the most useful things you can do with the distance command is make a non-physics object that's perfectly spherical.

    Distance tests don't work with collision cells, do they? Like, if you have a few thousand enemies spread over a large layout, and you are testing collisions against them, col cells will eliminate a lot of the overhead, whereas distance will test against everything--unless that's changed recently.

    Actually, I did an opt in one project where I was using pick nearest/distance for cols, then taking that distance and using it to determine how often to check cols. So...an object far away from anything it can collide with will check for cols much less often. Seemed to work pretty good even with boatloads of objects.

  • Here's an interesting article about asm.js that also discusses SIMD opt's and how they can affect speed. This was written before SIMD could be accomplished inside of javascript:

    http://arstechnica.com/information-tech ... -asm-js/3/

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This looks beautiful

    Reminds me of loot pursuit, but even more refined looking.

  • I think -- and I could be totally wrong, this is all a bit beyond me -- that this would be an additional boost over asm.js. I don't think you need to use asm.js to take advantage of it. But...I'd love to hear that from someone with a better understanding of all this.

  • Hillstrom

    I haven't dived into mobile yet, but given all that I've read, I've sort of been dreading it.

    I've also gone over the bulk of this thread, and I think your suggestion is the best I've seen so far. Having a definitive guide -- even for a simple game like Space Blaster -- would help immensely. Android would seem to be the best platform to start with.

  • I would like to be able to activate/deactivate a group dynamically in addition to by a string.

    Right now, when I change the name of a group, I have to go and change that name in many places. In some cases, addressing by string makes sense. But activating/de-activating is one case where I would rather my expression self-adjusts for the new name--like with variables, object names, and the like.

    Not a big deal...but a minor annoyance that saps my time repeatedly.

  • Heh, actually, I kind of like your 'wall of text'. It's...intriguing, to say the least.

    Don't think I'd want to see it every time on startup, but I'd at least stick it in a youtube vid or something. I really can't think of the last time I played a game that covered the apatheticism of objective morality(Bioshock? No, seriously...).

    P.S. What does hedenicide mean? Google isn't helping me here...