R0J0hound's Forum Posts

  • Well, either let you generate sound. Webaudio by letting you set the sound data directly and normal html5 audio by creating a wav file data URL to load and play. So both would work in my mind, however all over the net those that have actually made mod players cite normal html5 audio as tricky to precisely align one chunk to another. That isn't my expertise so I can only go by what I read. It doesn't mean they aren't wrong though.

    So I'd say it's fully possible. Of course getting that possibility to something usable will take work.

  • global number rateOfTurn=0

    global number previousAngle=0

    everytick

    --- set rateOfTurn to (sprite.angle-previousAngle)/dt

    --- set previousAngle to sprite.angle

  • Sure it's possible. The simple overview of a mod player is it takes the file and generates sound as it goes, a chunk at a time. Without webaudio it does this by creating a wav file that is then loaded and played. The issue is to make one chunk match the other precisely. Webaudio allows you to buffer sounds to be played seamlessly, as well as eliminating the the overhead of creating/loading the sound files by instead letting you write sound data directly. Of course the nitty gritty of it takes a lot more than that and some specific knowledge, not to mention a lot of time to make and optimize. Using an existing js library is dependent on if one can be found and devising a way to use from C2, which is a time consuming task in and of itself.

    Converting to ogg is the fastest solution and gives the best performance since sound doesn't need to be generated.

  • Probably using the collision polygon.

  • Well if a javascript library that doesn't use webaudio can be found, then maybe that can be used. Or you could just convert your mod files to ogg files with some other software perhaps.

  • Yeah, you'd create the object from the other layout to load the texture into vram. By default only the textures of the objects on the current layout are loaded.

  • There is already a synthesis plugin here:

  • This corner of the internet has a way:

    http://acko.net/blog/javascript-audio-s ... th-html-5/

    But that's just the basics.

    There also may be some older js mod players that don't use webaudio. Anyway I guess it's in the realm of possible, but unless someone makes it usable from C2 I guess this info isn't useful.

  • Try Construct 3

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

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

    The collision polygon isn't accessible from just events. That said, you can manually put the collision point locations in an array or something and just reference that instead. Or you can use a tiny sprite to find the collision shape by moving over an area and checking for collision.

  • I was refering to the one made by yann, which doesn't utilize the array object. Also you could also look at the json format that the dictionary object uses. You should be able to more easily adapt that text to be able to load into that.

  • blackhornet

    The iid isn't related to picking, it's the instance number of the object type. I've utilized this to access values in unpicked objects. Off the top of my head, one use could be to compare two random instances of the same type.

    global number other=0

    pick random sprite instance

    --- set other to sprite.iid

    pick random sprite instance

    sprite x < sprite(other).x

    --- destroy sprite

    liev04

    I didn't look into it previously but after a quick test iids are an instance number of a object type, not a family. So the object.iid will give the instance number of that type and not instance number in that family. However, the family(3).x style expression will give you the forth (counting from 0) instance in the family.

    A brute force solution could be to change the function to:

    on function "getiid"

    for each family

    system: compare function.param(0)=family.uid

    --- function: set return value to loopindex

    --- stop loop

    Another way could be to give the family an instance variable that you set to their index number when you create it. You'll also need to update it when an instance is destroyed. There's probably other ways too.

  • Since it looks like the segments have momentum I'd say some kind of chain of springs. Also when the head isn't moving the body just looks like a sine wave along the line from the head to the base, but that may be a result of the springs, at least somewhat. Another thought is it may just be a clever combination of sine waves to affect the angle.

  • Use a function.

    var = function.call("getiid", enemy.uid)

    on function "getiid"

    pick enemy by uid function.param(0)

    --- function: set return value to enemy.iid

  • Do a search, there are a few examples of this.

  • There's a third party plugin that could help you, or you can use some javascript with the browser plugin or your own to parse it.