R0J0hound's Forum Posts

  • 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.

  • Probably it could be done by using the effect on the game layer or layout, so you could just move the sprites around like normal. The difficult part is mapping billboard sprites to the 3d view (it's tedious math). Basically the same perspective transform the fx uses needs to be used to make it look right.

    I made an example in the topic and it works, but isn't simple:

  • Here's the example tweaked to work with rotated ellipses.

    For unrotated ellipses dx and dy are just (Sprite2.x-sprite.x) and (sprite2.y-sprite.y).

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

  • So I suppose it will have to wait till Tom gets back to resolve the issue.

    In the mean time shall we name our new spam buddy? I vote for something simple like Carl. All in favor?

    When the scirra office closes for the day the forum should change to a darker appearance with the message

    "What a horrible night to have a curse..."

    Bonus if they can get this music playing in the background.

    https://m.youtube.com/watch?v=7tNQXwjAlI0

  • Assuming in your array you use:

    0 for air

    1 for dirt

    2 for stone

    You could do the following as sub-events to a start of layout to populate the array:

    for "y" from 0 to 32

    for "x" from 0 to array.width-1

    --- set array at (loopindex("x"), loopindex("y")) to 0

    for "y" from 33 to 64

    for "x" from 0 to array.width-1

    --- set array at (loopindex("x"), loopindex("y")) to 1

    for "y" from 65 to 80

    for "x" from 0 to array.width-1

    --- set array at (loopindex("x"), loopindex("y")) to choose(1,2)

    I don't know how you're placing the tiles so you can see them but the usual way would be to loop over the array and create the correct tile based on the value in the array. Say your tile size is 32x32 you'd create the tile with something like "create dirt at (array.curx*32, array.cury*32)".

    It will be slow if you use a sprite per tile so a better way would be to use the tilemap object instead and set the tiles from the array.

    For hills and whatnot this post could be helpful, it also shows the use of the third party noise plugin:

    1.

    It all depends on how you're doing the trees, like will they be blocky or sprites. Either way you could loop over the surface tiles and occasionally grow a tree. One way would be to spawn random seeds in the air, let them fall and have them grow where they hit.

    2.

    For that perlin noise could be useful. Or you could use some oddly shaped and randomly placed sprites during the generate stage, and set all the tiles it overlaps to ore or something.

    3.

    The tilemap object will be your biggest friend for this as it's very efficient at drawing only what's on the screen regardless of how big the world is.

    4.

    I don't know of any off hand but I know there are lots of tutorials and examples to study. Do a search, I'm pretty sure there are examples that do as you describe.

    5.

    There are many ways to do it, but your idea and the approach you used in gm will most likely work here.

    As for 5 minute loading, I haven't ever encountered such a delay. If use a massive array it could take some time to loop over to generate, but otherwise I have no idea.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • striimix

    Sorry I haven't had a chance to look yet. I've been in a programming slump.

    GameThirsty

    It doesn't really play well with other behaviors. To make it respond realisticly you need to move the object with only the chipmunk behavior.

  • Here's a recent tutorial with a possible solution.

    https://www.scirra.com/tutorials/1447/u ... tial-games

  • eli0s

    This post is relevant:

    Basically it's because the quads can't be drawn with perspective since there's no real z.

  • One possible way to do a serial could be the following:

    So say you want the serial to be in the format of

    aaaa-bbbb-cccc-dddd

    1234-4567-8901-2345

    You can then let it be a good serial if

    a+2*b+3*c+5*d is in the range of (55000 to 55005) or something.

    To generate them you could do something like the following which should give you a few good serials.

    repeat 100000 times

    --- set a to int(random(10000))

    --- set b to int(random(10000))

    --- set c to int(random(10000))

    --- set d to int(random(10000))

    ------ a+b*2+c*3+d*5 is in the range (55000 to 55005)

    --------- save as valid serial.

  • Hi, would you consider making a plugin or behaviour out of your 3d object engine, please?

    Probably not. That would mean re-writing it in javascript which doesn't appeal to me.

  • WebMagi

    It's just a matter of using joints to link it together. Then to manipulate it with just physics you can use a dummy object that's moved by the mouse that you connect and disconnect from objects. Here's an example of a possible way to set it up.

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

  • WebMagi

    I can't think of any examples off hand, but a search for "angry birds" on the forum will give examples of a slingshot which is similar.