R0J0hound's Forum Posts

  • You can probably find something in one of my posts.

    The first thing is to detect the collision which is simple enough using the "is overlapping" condition. Next you need to get the objects to not overlap. One way to do that is to move the object backward till it's no longer overlapping, another is to push out in the closest direction which could either be done with some creative checking the around the sprite or using the Separating Axis Theorem (SAT) algorithm. The final thing to do is the actual bounce, usually that requires the normal or angle of the edge where the two objects meet. SAT can provide this or you can treat the objects as circles and utilize the angle between them as LittleStain said.

  • Not the camera, but you can make your graphics look like that.

  • wizdigitech

    Just don't use the debugger to view the contents of the array and it won't crash. Actually you should start the array with size (0,1,1). The push will increase the size.

    Alternatively here's another way I did a while ago. It sets the size of the array from the get-go and then uses find() to save on having to loop over every character.

  • You can test it currently. It works but no, it's not finished yet.

  • kmoon11

    Thanks for the elephant sample, that should be enough of a test case to get things working correctly.

    I'll have to decline putting this on github for now since I don't use github. If you want a link to the plugin this is where I'll keep a working download:

    Thanks for the technical help too, but it shouldn't be necessary. Between the source code, the documentation, and existing examples it looks like I've got everything I'll need.

  • zenox98

    The pause with ajax is the time it takes to load the file into memory from the disk. The disk is the slowdown here. When the project is exported then it would likely take longer to load from the net than from the disk.

  • This should be faster. I've used something similar before to load the entire English dictionary.

    Global text data=""

    Global text word=""

    Global text c=""

    On ajax complete

    -> set data to Ajax.lastData

    --- repeat len(data) times

    --- -> set c to mid(data, loopindex, 1)

    --- --- system: c=";"

    --- --- -> array: push back word

    --- --- -> set word to ""

    --- --- else

    --- --- -> add c to word

  • Some functions, but you can also make things simpler by not using a sprite per substance, instead have one substance object, but multiple instances and use a an instance variable to distinguish the two. If you do that you can reduce the amount of events down to five even if you have hundreds of substances.

    For multiple players I'd just add multiple instances of your player object and add a variable to distinguish between the two. The dictionaries relate to a single player so I'd put them in a container so each player has their own. Then adding a "for each player" to the last three events should get you most of the way there. The function will need to be modified so the player.uid is passed as well, then the first thing the function should do is pick by uid the passed value. You can do it without a container with variables but I don't feel like working that out.

    OBJECTS:

    Dictionaries: sub_dict, potion_dict

    Sprite sub_sprite with text variable "name". Set the value of "name" to the name of the substance.

    Spritevplayer with text variables "slotA" and "slotB". Both should start with a value of "".

    EVENTS:

    player: on collision with sub_sprite

    [inverted] sub_dict: has key sub_sprite.name

    system: compare: player.slotA+player.slotB <2

    --- sub_dict: add key sub_sprite.name with value 1

    on function "make potion?"

    sub_dict: has key function.param(0)

    sub_dict: has key function.param(1)

    --- potion_dict: add key fuction.param(3) with value 1

    --- sub_dict: delete key function.param(0)

    --- sub_dict: delete key function.param(1)

    every tick

    --- call function "make potion?" ("substance1","substance2","potion1")

    --- call function "make potion?" ("substance1","substance3","potion2")

    --- call function "make potion?" ("substance2","substance3","potion3")

    --- ... and so on

    Potion_dict: for each key

    player: slotA = ""

    --- player: slotA set to Potions.CurrentKey

    --- sub_dict: delete key Potions.CurrentKey

    Potion_dict: for each key

    player: slotB = ""

    --- player: slotB set to Potions.CurrentKey

    --- sub_dict: delete key Potions.CurrentKey

  • I made it less than a month ago so it's still new. Since then I haven't touched it. I usually code in spurts instead of slow and steady.

    What is left to do with it is pretty simple. Just adding actions to change the animation, the speed, the position in the animation, and animation blending. It's just a matter of using the functions built in to the js library provided by Krestel Moon so it's not complicated, I just haven't done it. As far as rendering with webgl it's complete, but I probably won't get it working if webgl isn't available, and making it render in the editor is impossible.

    I can't run the software on my Vista machine (it needs 7+), and so far I've only found one export and that has only one animation in it. If I could get an export with two or more animations in it then I can get the animation blending working. Without that I can't test it, and coding blind is the best way for it not to work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Use the search.

    search.php

    Nothing comes up with the keywords of your title: "breakable tilemap".

    So use good old google to find synonyms for "breakable".

    https://www.google.com/search?sclient=p ... +breakable

    Destructible looks good.

    Profit:

    search.php?keywords=destructible+tilemap&terms=all&author=&sc=1&sf=all&sr=posts&sk=t&sd=d&st=0&ch=300&t=0&submit=Search

  • Search first.

  • Prominent

    I do not understand what is happening here.

    If in the editor

    sprite2.angle = 95

    sprite3.angle = 240

    And you make an event like:

    Start of layout

    --- create gear joint with phase = sprite3.angle-sprite2.angle

    Then sometimes the objects will rotate 360 before settling.

    However if you set the angles with events then it's perfect.

    Start of layout

    --- sprite2: set angle to 95

    --- sprite3: set angle to 240

    --- create gear joint with phase = sprite3.angle-sprite2.angle

    or you even can do this:

    --- sprite2: set angle to self.angle

    --- sprite3: set angle to self.angle

    --- create gear joint with phase = sprite3.angle-sprite2.angle

    EDIT:

    Ah, I see what the issue is. Internally in C2 angles can be any value. When you access them however, they are always returned in the range [0,360). So it would be a fix from my end. Till I do that the above solution will work.

  • Here's a link with some ideas:

    http://stackoverflow.com/questions/2165 ... y-web-site

    None of them seem perfect though.

  • Prominent

    It's hard to say without a capx. It would be odd if the joint got offset but I suppose it would depend on the joint type.

    Is the dragging similar to this? (from the first post)

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

  • The "else" isn't needed, and the negated != is a double negative, wouldn't it be easier to just check "="?

    This should work. You pick the searcher instance like you have, then you filter the targets that meet the condition, and pick the closest from them.

    Searcher: pick by uid [something]

    Target: var = [something]

    Target: pick closest to (searcher.x, searcher.y)

    --- do something

    That leverages the picking system. If you want to do it a code way you can just use "for each" and "system compare" (same as a if). You can think of a uid as a pointer.