codah's Forum Posts

  • I want a text to constantly(and randomly) change texts.

    So i want it to change every time the user presses a button or so.

    So which is it?

    It seems you want to know 1 or more of the following:

    Q: How to change text to different words

    A: System:Every tick -> textObject:set text to "hello"

    Q: How to do something randomly

    A:

    System: Every tick -> Set MyVar to random(1, 5) (or choose( 1,2,3,4,5))

    System: MyVar = 1 -> action 1

    Else

    System: MyVar = 2 -> action 2

    (etc)

    Q: How to do something every so often

    A: System: Every 1.0 seconds -> action

    Q: How to do something when the user presses a button/sprite

    A: Touch: On tap gesture on MySprite -> action

    Maybe you can put it all together

    Edit:

    Hint: Use an array to store the words, then use the randomly chosen number as the index into the array

  • System: On canvas snapshot -> Sprite: Load image from CanvasSnapshot

    From the manual:

    [quote:komrhs97]Layout

    CanvasSnapshot

    Contains the resulting image from a Snapshot canvas action after On canvas snapshot has run. (Note this expression is not available immediately after the Snapshot canvas action - you can only use it after On canvas snapshot triggers.) The expression returns a data URI of the image file. This can be loaded in to a Sprite or Tiled Background object via Load image from URL, sent to a server or stored locally, or opened with the Browser object in a new tab to save to disk.

  • Maybe you could describe it better

  • I do enjoy a challenge but.. I think the OP just wanted his game to work

    Maybe we should have a "challenge of the week" forum No add-ons allowed!

  • codah Awesome thank you so much! that finally got it haha.

    Now.... I just need to know how to make a difficulty button with the same behavior that has 3 options (easy, normal, hard) any ideas?

    )

    If you need to model 3 states, you will need a number variable instead of the boolean one (you should've said that's a requirement Then you will probably look into arrays..

    Then instead of Toggle Boolean you will have something like (pseudocode)

    btntxt:Set self.my_state to (self.my_state < 2 ? self.my_state + 1 : self.option_text_1)

    or you could use the % operator to 'wrap around' the values.

  • haha shinkan I guess there's a reason we have add-ons. Anyway good luck.

  • Don't have time to do a capx now, but I have done a similar thing before.

    First set touch sprites and options text as container of each other so they get picked together.

    Local var options_uid

    On Touch TouchSprite1

    -> set OptionsText opacity to 100

    -> system set variable options_uid to OptionsText.UID

    then

    System: Every Tick

    /System: Pick all OptionsText

    /OptionsText.UID <> options_uid

    -> set OptionsText opacity to 30

  • I made an example, but then I noticed Colludium made it almost exactly the same

    Posting an image anyways

    Go back a page, you'll notice they've both become virtually same as my earlier example (except I use LiteTween)

    Anyway this has been fun. I'll know what to do if this requirement comes up

  • Just make them instance variables and make sure you choose the type 'boolean' for my_state. That message means you haven't done that. Copy the capx exactly I doubt your C2 is damaged.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have updated my above post with instructions for using the capx, if you're interested

  • Well done. It's quite playable and I even like the look and feel of the art Just add more levels, a new element here and there, etc. Cool.

  • ive had an issue like this before

    try going to preferences/preview and click the preview on Lan address button (like when you set it up ) and see if it lists a new address my old router made me change this every time i reinstalled between two addresses

    hope that helps

    Got it in one. Thanks man.

  • Since installing 176b (or so it seems) I suddenly cannot preview as I always have, on Chrome. To my knowledge I have not changed any preview settings. I now get the message "Unable to start HTTP server on ..." and that I should start with admin privileges (which I have set on the shortcut that I use). It does work with localhost.

    I did re-install 173 stable, and still have the issue, so I've gone back to 176b.

    Thanks in advance.

  • Hm that's a shame.. Be sure you have the initial opacity values, etc. correct on your sprites. Use mine as an example. You could post your capx, or PM it to me.