Geoffroymonde's Forum Posts

  • Hello,

    My game has an inputtext option for the player.

    The player doesnt actually see the inputtext box, because I linked its content to another text box (let's call it "output_txt_box"), for aesthetic reasons.

    So when the player types on his keyboard, the text is seen in the output_txt_box.

    I want to limit the number of characters that the player can input, but I want this limit to correspond to the size of the output_txt_box.

    Which means any solution having to do with the number of characters ("len", etc.) won't work in my case, as typing a 100 big "A" won't occupy the same space as typing a 100 small "i".

    But that's exactly what I'd like to accomplish : that the limit in the number of characters corresponds to the bottom right corner of the output_txt_box.

    Any idea how to accomplish that ?

    Here is a preview of my output_txt_box :

    Thanks !

  • Ok, but won't it create issues when exported, like when the player plays on a website (or even in a window) and resize his window, scrolls on the page, etc ?

    Is the problem only happening in the preview window ?

  • Oh, you're right, when changing the size of the preview window, the whole sphere effect changes, and adapt (eventually looking like intended at certain sizes).

    I noticed even when zooming and moving around in the layout view, the sphere effect reacts strangely in real time. Is there any way to "lock" this effect ??

    As you can see, the sphere effect "follows" the scrolling down of the layout scroll bar. Is there a way to apply this effect without it moving around like that ?

  • Hye !

    I'm using a sphere effect to emulate an old monitor screen effect.

    When parametering the effect in layout view, it works perfectly, but everytime I preview the layout, the sphere effect acts totally differently from expected.

    Layout view :

    the effect parameters :

    preview :

    Does anyone have any idea why I encounter this problem ?

    Thanks !

  • Thanks, I'll try that !! Seems simple enough, indeed !

  • Yes okay, I see what you're proposing. It's what I have in mind, but I don't see how to implement it.

    Since all players are instances of the same object (created at runtime), I don't understand how having a variable on that object would work.

    Like, if it is a boolean ("activeplayer"), it will be set True at the start of the layout for one of the instance (the one the player controls at the beginning of the game) ; and then, as soon as the player passes the ball to another instance, how would the boolean would have to be set up so it switches when the collision happens ? It can't be switched off while the ball is being passed, as the player will want to still control his character until the ball reaches another instance of the player...

    I feel like I'm missing/misundertsanding something very basic for it to work...

  • Hello !

    I'm trying to create a small soccer game to learn more about construct.

    I created a sprite for the player, and have coded some basic movements and actions with him and the ball.

    Now I'm trying to have the active player (the player answering to the controls) switch everytime the ball is passed to another player sprite.

    Note that all player sprites are created on runtime from the same object, and thanks to a function, hey each recieve a unique ID variable on creation ("player00", "player01", etc.).

    So on startup, I can differentiate which player is which (and for now, all the controls are attributed to the first player sprite created). How can I use that knowledge to create some kind of "active player" condition and have my coded behaviors separated between the active player and the AI ?

    Thanks for your help !

  • Okay, thank you !

  • Hye, thank you for your response !

    Unfortunately I have a hard time figuring it out ; it looks like the scale of the sprite is set in two different "every tick" actions ? Also, "sprite: set savedscale to self.width/self.originalWidth" a division or just a slash symbol ?

  • Try Construct 3

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

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

    My project has sprites that all have collision polygons set up to react to the hovering of the mouse ; and the behavior of those sprites is to scale up a little bit when the mouse is over it (and then scale down when the cursor goes away).

    My problem is, the collision polygons scale up too - and that can create some glitchy behavior from the mouse cursor (it looks like it's staggering at ultra speed whenever it is "caught" between different states of the scaling sprite).

    How can I avoid that ? One way would be to create collision polygons on invisible sprites on top of the actual sprites so that they don't scale up at the same time as the actual sprite ; but it's going to be long to set up (I have many sprites of different shapes), so I was wondering if there was an easier method to go about it I didn't think about ?

    Thanks for your input !

  • Thank you all !

  • Thank you both, I'll try that !

    I was trying to set up all this without setting up in a "test" layout, which is kind of a way I already know about ; I was more looking for a totally code-dependant way of creating all this dynamically.

    Nonetheless, it's still a good advice to achieve my goal !

  • Hello everyone !

    I'm trying to automate a particular behaviour of buttons being created at runtime.

    When the player clicks on a sprite ("Sprite1"), a serie of new smaller sprites ("Sprite2") should appear all around Sprite1.

    Every Sprite2 is visually linked to Sprite1 with a solid white line.

    In the end, the Sprite 2 should look like the rays of a sun, evenly distributed all around Sprite1, regardless of their number (for example, if 4 Sprite2 are created, they would each go in a different direction at 90°, but if there are 6 Sprite2, they would each be at 360/6° all around Sprite1, etc.)

    Then, once every SPrite 2 has appeared, they will each spawn another sprite ("Sprite3") on their center - but each one of those Sprite3 is different (but has to be distributed in the right order) - I have a hunch using families will be useful for that one...

    Here is the code I wrote for the spawn animation of Sprite 2 (composed of a line and a square) ; the sprite named "subbut_mouth01" corresponds to a Sprite3) ; to summerize : when the player clicks on a button, a white line is created on the originPoint of the button ; that line is created at 0 height, and goes to a 150px height with a lerp ; once that height is achieved, a white square is also created on the top origin point of the white line, and then, once the square is at the right dimensions, the Sprite3 appears in the square)

    And here is a quick sketch of what I'm trying to achieve :

    What I'm having difficulties with is :

    - automate the creation of Sprite2 with only a simple parameter (the number of instances to create) to adjust, with that parameter being also linked to the angle at which every new sprite2 should be created

    - specify in the code which sprite3 should go with which sprite2 (I'd like that to be "automatic", as long as there are the same number of sprite2 that appear as there are sprite3 needed to display.

    Thanks in advance for tour help and tips !

  • Okaaayy ! I didnt know the mere hierarchy of the orders was enough for something like this to be consistent !

    Thank you very much, I'll try this !

  • If you create a sprite called blueSprite, you can load its UID into variable whoAmI with

    whoAmI=blueSprite.uid.

    If you want to use that specific sprite again later you can get it with

    pick blueSprite by UID whoAmI.

    I hope this helps.

    yours

    winkr7

    Hye !

    Thanks for the walkthrough.

    Would it work the same if there are 4 instances created at the same time ? How would the variable identify which is which ?