szabesz's Forum Posts

  • bigcatrik I have tried it out a bit as well and I really like the gameplay in general, nice work! However, I do not get why you chose that song for the background music as I think it does not match the game.

    Anyway, thanks for the showcase! I like dungeon crawlers :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, I've been working on this simple 2d platformer.

    https://kallo-games.itch.io/robo-ezcape

    Hello, I like it. Simple but fun, well done! I could reach level 6 easily but stopped at solving the laser issue :) I'll take closer look next time.

  • Hello, thank you for this showcase! This "3D shapes and 3D object plugin" looks promising. I hope that one day something like this will be in C3 out of the box. Till then happy "experimenting" :)

  • Haematite Thanks for sharing and for all the efforts for supporting this project of yours!

  • Hello, this bit will surely not work:

    player.testOverlap(....
    

    As in this case player is a reference to an array of objects, not to a specific sprite object.

    See getAllInstances() on: construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/object-interfaces/iobjectclass

    Return an array of all instances of this object class.

    You need to find your given sprite object in the array. If you have only one player, then player.getFirstInstance() should do it. You also need to do the same to find the given ground object in your ground array.

    One way to look for a specific object in an array can be seen in this post:

    construct.net/en/forum/construct-3/scripting-51/handle-clicks-object-js-154194

    In that example, in the function the // loops through all sprites for loop is used to get a reference to each sprite in the array.

    If you - for example - have an instance variable named myID added to the sprite in the Editor, then in the JS for loop you can get its value like this:

    const myID = sprites[i].instVars.myID;
    console.log(myID);
    

    Hope this helps.

  • fyi for posting gifs:

    Thank you! As soon as I will be allowed to edit post, I will fix it.

  • I just did something similar yesterday, I think. Please see the attached images. I create a grid of people, and set the sprite frames and text labels based on a JavaScript object, similar to yours. I wrote a "parser" function to grab the data from the JS object.

    What I was struggling with is the type of variables. You must make sure your event function is set to receive the proper return type and also the proper argument types, as the C3 runtime does not seem to do the coercion the same way as JavaScript does. I resorted to using strings only for the communication between JavaScript and C3 runtime and convert them to numbers in the C3 actions where needed.

    Check out the "Integrating events with scrips" demo projedct to learn how to set local and global variables.

    Hope this helps.

  • Rum time! woo hoo!

    Drinking to much rum can make you misread words, I guess ;)

  • szabesz

    If you want a specific bottom button to intercept the clicks too, you can set this property : "Ignore Input" to false in the button behavior.

    If you want this kind of behavior applied to ALL of your buttons project, then set "stop click propagation" to NO in the proui plugin propery panel, but you probably dont want that.

    Aekiro

    Thank you for your quick reply! Now I know what "Ignore input" means, I should have tried that, I guess.

    If I set it to "No" then the event propagates to the sprite in the background as expected. So clicking on the sprite above the other one works this way. However, clicking on the sprite below the front one does not make the two behaviors work at the same time because the JS event does not propagate "backwards". The sprite on the front is transparent, so it does not receive the click event when clicking on a transparent area, I think.

    So how is it possible to make this combo work no matter which sprite I click on? Am I missing something, perhaps?

    I am happy to code it in JavaScript if that is the only way to solve it. Is there an interface for the button just like the Scirra behaviors have? Of course, if I can do it wihotut JavaScript, I am even more hapier that way.

    Thanks in advance.

  • Sorry for the wrong attempt to insert a gif, clearly, I have no idea how I should do that.

    I am not jet allowed to edit my post as this is my second post on the forum. I am sorry for not being able to use the forum properly.

  • Hello, Does anyone know how to dispatch a click/touch event from JavaScript so that the PRO UI Button behavior handles it (so that I can trigger a click event on the given PRO UI Button behavior)?

    Something like this (but this one does not work...):

    const event = new C3.Event("Click");
    runtime.objects.myButton.getFirstInstance().behaviors.Button.dispatchEvent(event);
    

    Is it possible at all, somehow?

    What I am trying to achieve is that if I have two sprites one on the other then clicking on them only triggers the Button behavior for the one on the top. I have different behaviors appleid to each sprites and I would like to run both on click/touch.

    Here is what happens currently when I click on the foreground sprite and after that I click on the background sprite:

    szabesz.hu/_dl/who-to-trigger-both-events.gif

    Any ideas how to achive that?