R0J0hound's Forum Posts

  • The math was visual initially too. Although I only roughly recall how I derived it.

  • "-1" just means there is no tile there. Your capx referenced tilemap instead of tile in the event which is a simple mistake. Anyways here's a working example. Instead of creating a bunch of tile sprites it just moves around one to do the detection. The advantage is it eliminated a few events.

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

  • While 90 is a "right angle", in this situation right angle means the correct angle. LittleStain's example visualizes it perfectly but you can simplify it to just this:

    projectile: on collision with target:

    --- projectile: set angle of motion to 2*(angle(Self.X,self.Y,target.X,target.Y)+90)-Self.Bullet.AngleOfMotion

  • According to Ashley it's a limit done by the browsers themselves:

  • I'm guessing it's because it's not a public link from your dropbox. If you log out of dropbox, you probably won't see them either. You should be able to "copy public link" for your files.

  • Event #2 creates all the Sprites in a rectangle and event #3 removes the sprites not overlapping. So to actually make it delete tiles you need a new event below all that:

    Mouse button is down

    for each tile

    --- tilemap: erase tile at (self.positionToTileX(tile.x), self.positionToTileY(tile.y))

    To make it only happen when you need it, put all the events in a group and disable/enable it as needed.

  • depending on your game logic, it may have been asking for the value from the dictionary before it was set. That would make it's value NaN.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Using notepad++ to open the exported runtime.js and data.js, it says utf-8.

  • I think it's just one of those things that have to be dealt with when dealing with rounding floating point positions to integer.

    As far as rounding the camera position, couldn't you use two variables to store the floating point camera position and always round them when setting the scroll position?

    I've done something similar to what you described before, but it was mainly for collision precision purposes instead of rendering.

  • Here's one way to do it:

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

    To satisfy the requirements of the first two images you need to only let the blocks fall if all of them are destructible. The logic looks like this:

    global number cnt=0
    
    +---------------------------------------+
    | player overlaps block at offset (0,2) | set cnt to block.pickedCount
    +---------------------------------------+
        +-----------------------------------+
        | block is destructable             | let block fall
        | cnt = block.pickedCount           |
        +-----------------------------------+[/code:21xe7lsc]
    
    The block delay bit can be done with by queuing the blocks to fall up and letting them fall one by one.
  • Form controls like the button take the keyboard input when clicked on. You can either use the "set unfocused" action of the button, or use sprites instead that you can click on.

  • I'd imagine it would be faster to change an object's visibility, rather than creating/destroying it.

    In both cases the object wouldn't be drawn, so rendering performance would be the same.

    If the object isn't destroyed it's still available for interaction though.

    Both have their uses, and it shouldn't be an issue of which is faster, instead just what makes sense in that situation. Usually I make invisible stuff that I'll either make visible again or just use for interaction. Whereas I destroy what is no longer needed.

  • It looks like a bug which would be good to report.

    You can probably work around it by using :

    float(Dictionary.Get("attention")) instead of Dictionary.Get("attention"). I'm guessing the value of "attention" isn't a number, or at least isn't right away.

  • The first capx attached here should help:

    It highlights all the tiles that overlap the tiles, but you could then take that and clear those tiles.

  • I can't see your images, so I can't say what the issue is.

    Here are some examples of some working implementations if it helps.