R0J0hound's Recent Forum Activity

  • Ashley

    It must be, but no worries, it's purely cosmetic and isn't too bothersome. I'll keep an eye out for a working solution though.

    In regard to buggy drivers I read this post by a guy who worked on nvidia drivers for a bit. It turns out when they update the driver they not only fix bugs in the driver but they also make patches so games relying on the broken driver can still work. It's both fascinating and frightening.

    http://www.gamedev.net/topic/666419-wha ... try5215019

  • Webgl2 just is a 2nd iteration of webgl witch is more like newer versions of opengl which can take advantage of newer graphics card features. It will be a while before it's as widespread as the current webgl. I'll maybe get more excited about it when webgl is better supported. Support on my system has been doing the opposite of advancing with newer versions of chrome and firefox completely blacklisting my graphics card so I can't use webgl at all unless I use older versions.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could also do something tricky like this:

    https://dl.dropboxusercontent.com/u/542 ... ctoe2.capx

    But really tic tac toe is rathar simple although tedious. I like to opt for as few object types as possible but you could just as well just make a sprite per location.

    Each sprite will have 3 animation frames "blank", "x" and "o". Be sure to set the animation speed to 0 so the frames don't change.

    Placing an x or o is just a matter of using the event:

    on sprite clicked

    --- set animation frame to 1 or 2

    I used a variable to keep track of whose turn it is, and switched it every time a player placed a piece.

    global number turn=1

    on sprite clicked

    --- set animation frame to turn

    --- set turn to 3-turn

    Setting turn to 3-turn is just a simple way to toggle turn between the values 2 and 1.

    Next comes the tedious part of checking for a win. It's very simple in concept, just look at each row,column and diagonal and see if there's three x's or o's in any of them. This is where you choose an approach you like.

    One way is to use an array that you set from the visible x' and o's. This then makes it simpler to write like other programming languages, so you can check certain locations.

    Here's an incomplete example of a very verbose way of checking for each win, for each player.

    https://dl.dropboxusercontent.com/u/542 ... ctoe3.capx

    Using loops help a lot to simplify things, and blackhornet's tutorial does just that.

    Another way as I have done is to utilize picking to pick a row, column or diagonal in some way like I did.

  • Thanks for the quick fix, but unfortunately I just tested the update and there's no change, the sprite still becomes invisible. So I guess that wasn't the issue in this case. Still it was worth a shot anyway.

  • Problem Description

    On older ati cards (ones that you can't get a driver for newer than 2010) sprites with non-power of two textures become invisible when you make them smaller.

    Attach a Capx

    https://dl.dropboxusercontent.com/u/542 ... e_ati.capx

    Note: this is a ati driver bug so you likely can't reproduce.

    Description of Capx

    This just a sprite with a 200x200 texture resized to 50x50. The result on my radeon x1200 series card is the sprite is invisible.

    Steps to Reproduce Bug

    • Step 1: Create sprite with a non power of two texture size.
    • Step 2: Resize the sprite smaller till it fades to invisible

    Observed Result

    When in the editor and I resize a sprite that has a non-power of two texture, it becomes invisible after shrinking it to a certain size.

    Expected Result

    I would expect the sprite to not become invisible.

    Affected Browsers

    N/A, it is a editor issue.

    Operating System and Service Pack

    Windows vista sp2

    Construct 2 Version ID

    r205 32bit

    Proposed Solution

    The bug has been reported a few times before and always has been closed as a driver bug, which is understandable since something like this is near impossible without being able to reproduce it. But recently I was working on something else in opengl where stuff was invisible and found the cause and a solution.

    Basically the mipmaps aren't being created when using glGenerateMipmap due to an ati driver bug. Usually the solution is to update the drivers but that is impossible on cards like mine. I then stumbled upon this which gives a solution that worked for what I was working on.

    https://www.opengl.org/wiki/Common_Mist ... generation

    [quote:xzoylwwc]Warning: It has been reported that on some ATI drivers, glGenerateMipmap(GL_TEXTURE_2D) has no effect unless you precede it with a call to glEnable(GL_TEXTURE_2D) in this particular case. Once again, to be clear, bind the texture, glEnable, then glGenerateMipmap. This is a bug and has been in the ATI drivers for a while. Perhaps by the time you read this, it will have been corrected. (glGenerateMipmap doesn't work on ATI as of 2011)

  • You could also do something like this:

    choose(0,180)+random(-1,1)*45

    If 45 is two wide reduce it to a smaller number.

  • I don't think the "for each" would be the issue. I'm kind of curious if the "or" us throwing it off when combined with the drag n drop behavior. It shouldn't though. Actually it could be the drag n drop behavior isn't correctly handling multiple objects being dragged at once.

    Until we can prove that one way or another we could get rid of the dragndrop behavior and do it ourselves with events. Like so:

    on sprite2 touched

    --- set id to touch.id

    --- set dragging to true

    dragging is true

    for each sprite2

    --- set position to (touch.XForID(Sprite2.TouchID), touch.YForID(Sprite2.TouchID))

    on any touch end

    pick sprite2 id = touch.id

    --- set dragging to false

  • Yeah that's the changes as I described. Can't see what's amiss. I'm unable to test. :/

    Ok, the general idea for multi touch is each new finger press has an id.

    When you touch a sprite2 the current is saved in a variable so you know which sprite2 goes to what finger.

    The code above is supposed to loop over each sprite2 and basically move to the closest point on the circle near that sprite2's assigned finger.

    But if it doesn't work then I'm kind of stumped until I do some testing on a multi-touch device.

  • Sorry, I think I neglected the fix in LittleStain's capx. I don't use multi-touch devices so I didn't test. The fix is to do what LittleStain did in his capx.

    1st add this event:

    on touched sprite2
    --- sprite2: set touchID to touch.touchID[/code:36jgbpqk]
    
    2nd replace sprite2.x and sprite2.y with
    touch.XForID(Sprite2.TouchID)
    and
    touch.YForID(Sprite2.TouchID)
    
    That should make it behave like LittleStain's capx.
  • Use a regex expression to do that:

    RegexMatchAt(AJAX.LastData, "01.*!", "", 0)

    Regex is very powerful and allows you to do a lot of cool text searching.

    https://developer.mozilla.org/en-US/doc ... xpressions

    This is the expression I used:

    01.*!

    What it does is:

    0 matches "0"

    1 matches "1"

    . matches anything

    * matches any number of the previous. Or in this case anything

    ! matches "!"

  • After you create the bullet and the enemy with the same angle as the enemy then this action should do it.

    Bullet: Rotate min(80, anglediff(angle(enemy.x,enemy.y,player.x,player.y), enemy.angle)) degrees toward (player.x, player.y)

  • TiAm

    I haven't touched it in a bit, but one thing I found was it seems to grab the frame 4 frames back but not always immediately. If you use the "load texture from canvas" four frames in a row then it should for *sure grab the canvas. At least as I recall.

    *tested with chrome on desktop. It might be something internal to how the browser works.

    The the main issue is copying the canvas to a texture is not undefined behavior according to the webgl spec, which might explain why iexplorer doesn't work. i had thought it might be an issue of when I grab the canvas but I haven't been able to find any place that works better.

    One thing that I could investigate further is enable a flag when the webgl context is created to tell it to save the canvas' texture after every frame. The drawback is it's not something I can do from the plugin, I'd have to change it in c2's runtime. The second drawback is the webgl spec has an ominous warning that says enabling that flag can have an overall performance impact.