Laurent's Recent Forum Activity

  • I'm building an engine to populate a layout with instances by using an array that contains instance X and Y, opacity, visibility, etc.

    Instances are connected between them and array also contains their connections in a way that if I click on an instance, the related instance will flash. This is determined by the column called Next in the json. In this case, Instance 1 flashes Instance 2, Instance 2 flashes Instance 3 and

    Instance 3 flashes Instance 1.

    So far, I was not able to build this connection between sprite. My attempt is line 5 and 6 of the code.

    I'll be grateful if someone could help me with this.

    Also : I'd like to have more than one connection between instance. For example, instance 1 when clicked flashes instance 2 and 3. I thought about populating the array with strings like "2,3" but don't know how to parse them.

    C3p can be found here https://www.dropbox.com/s/lyvoap25so4bs6p/SpriteFromArray_Test.c3p?dl=0

    Tagged:

  • It perfectly does the trick. Thank you !

    Thank you, in the later videos I have increased the Construct font size to show better what I am writing.

    For your issue add a sub event, if sprite is visible, then Array.at(X,Y,Z) = 1, else 0.

    That should do the trick.

  • Thanks! I will subscribe to your channel :) point is I have a 13' laptop and it's very difficult to read the writings on the screen.

    BTW, Something else I need to do : in my array, I stored values like coordinates and opacity. But I'd like to store booleans to define sprite visibility. I tried using 0 and 1 but visibility is only a matter of True and False. How can I test 0 and 1 within my loop and turn it into False/True ?

  • I was wondering, In my array, I stored values like coordinates and opacity. But I'd like to store booleans to define sprite visibility. I tried using 0 and 1 but visibility is only a matter of True and False. How can I test 0 and 1 within my loop and turn it into False/True ?

  • > I think I get it : Sprite #0 is sprite i did put myself on my layout on the editor. I removed it and everything is fine now !!

    Well, you typed faster than me :D

    You've been of great help BTW :)

  • I think I get it : Sprite #0 is sprite i did put myself on my layout on the editor. I removed it and everything is fine now !!

  • Try Construct 3

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

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

    My array has 4 rows numbered from 0 to 3.

    I did what you wrote, from 0 to TabHeight -1 and its removes the last sprite on 0,0.

    But I still have this first hidden sprite #0 outside the layout at 580x-157 which are coordinates that are nowhere to be found in may array.

  • Thank you dop2000 !

    I did this and no more infinite sprites are created. But this time, 4 rows are detectect in there array, as it should be, but 6 sprites are created, #0 in a location outside the layout I can't understand, and #5 at point 0,0. I can't explain this. #1 to #4 are correct

    Here's a screenshot and c3p has been updated

  • Hello

    I'm trying to automatise the creation of a layout by using an array to store sprite coordinates and frame number.

    Here is how it works :

    - coordinates and frame numbers for sprites to display are stored in an array

    - loop fetches coordinates from the array to display sprites

    - loop fetches frame number to change sprite appearance

    Everything works fine except that loops continues to create new sprites every click at point 0,0 and I can't understand why..

    Any idea on how to fix this ?

    Construct3 file is here :https://www.dropbox.com/s/hb5wwyz13oikfyb/SpriteCoordinateArray.c3p?dl=0

  • Thank you dop2000 !

    So, my variable in classic Construct Event sheet wil be 'd' ?

    As for not working on Safari, I used it to generate a value to check if we were in a given month (true/false) and it worked as if false was always returned regardless it is the case or not.

    Same test did work on Chrome but not in Safari.

  • I have a variable in my Construct project called Month and I would like to give it the value of the current month using javascript method w3schools.com/jsref/jsref_getmonth.asp

    How can I do that ?

    I know there is now a Date object in Construct 3, but somehow, it doesn't seem to work with Safari

    Tagged:

  • That was fast !!

    Thank you so much ! Easy but syntax is a bit tricky

Laurent's avatar

Laurent

Early Adopter

Member since 18 Jan, 2012

Twitter
Laurent has 1 followers

Trophy Case

  • 12-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies