AllanR's Forum Posts

  • ReallyBasic

    something like this? I have them fade out so you don't end up with a million instances bogging things down.

    https://www.rieperts.com/games/forum/tanktracks.c3p

  • it should work - probably security settings on your phone...

  • koshnaranick

    there are a couple ways... first way, click on Layout 1 in the Project window on the right, then click on "View" by Project Properties over on the left side of the screen... look under Display, and change Viewport Size (default is 640x480)... make it 800x600 or whatever you want.

    another way is add an action to event 1 "On Start of Layout"

    add System - Set Layout scale to 0.5

    that will zoom the camera out to 50%

  • Fengist

    I know that when I use "Browser - On Resize" I have to add "Wait 0.2 Seconds" before I update all the elements on the screen, because it seems to take some time before the viewport settings finish getting the new screen values.

  • You do not have permission to view this post

  • CheeseLife

    you could keep all that data in an array, and then it is a single structure to save and load from local storage.

    that would also let you expand the data stored - you could keep the top 10 best scores for each game type, save the date, user name. etc... and still only need one get and set.

    EDIT: also, you don't need to check if key exists and then get it. checking returns the value stored if it does exist.

    EDIT2: it also looks like you are checking local storage every single tick - 60 times a second. you really only need to read local storage at the start, and then save at then end of a game if the score is greater than then last high score. (although I can't tell for sure how your code is structured based on that image)

  • Jirianne

    how much text is it? 100 characters? 1000? 1 million? Have you tried debug mode to see what the contents of the text object are? are there any weird formatting characters in the text?

    you could also try changing the wrapping on the text object to character instead of word. Also try making the text object even bigger...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • the way I like to delay actions is to make a global variable to indicate that some kind of sequence is running - so that when the sequence is over, nothing is happening (other than checking if a sequence is running).

    and I use a variable "Delay" set to how long to wait. Every tick dt is subtracted from it, so when it gets down to zero, the next step can take place. that step then sets the length of the delay until the next step or marks the sequence as complete.

    that code creates 4 objects, two seconds apart, at an X of 0, 50, 100, 150.

    the first object gets created immediately because Delay starts at zero.

    EDIT: of course there are lots of other ways to achieve similar results: if you are using tweens to make something happen, you can advance the sequence when the tween ends, or if you have a sequence of animations, you can advance the sequence when the animation ends, etc...

  • hmmm, it would never have occurred to me to put an else after a loop.

    I just tried it out, and it seems that the else always executes - either after a stop loop, or when the loop completes naturally.

    so, I don't think it will help you determine if nothing was selected in the loop - you will have to use a bool.

  • LoseBiene

    Multi touch get pretty tricky, and there is no way to know how many fingers a player may try to put on the screen, so it is best to track all touches and decide what each one is allowed to do.

    I like to create a sprite called TouchPoint that has all the instance variables I need to track the touch - where it started, where it is now, where it just was, how long it has been in touch, etc...

    I made two global variables: PlayerTouchPoint and GunTouchPoint to lock control of the player and firing the gun to one TouchPoint instance. That way, if the player isn't watching where their finger is, the same touch will keep doing what the player wants it to do.

    so, this will work with any number of touches starting and stopping, but only one at a time can control player movement, and firing the gun.

    https://www.rieperts.com/games/forum/touchinput.capx

    NOTE: I always have a HUD layer and put the TouchPoints on that layer so that any scrolling of the layout doesn't interfere with tracking how much the player's finger has moved.

  • N0M4D

    the problem is that both blocks of code will run.

    in the first block you check if Enter has been pressed, then set paused to true.

    the next block checks if Enter has been pressed AND if paused is true (which it will be because you just set it to true) and then it will un-pause your game.

    You should use ELSE to make sure both blocks don't run.

    	EVENT: On Press Enter
    		> is paused - set paused false, set timescale 1
    		> ELSE - set paused true, set timescale 0
    

    then I would expect a global variable would work fine...

  • check out an old sample I made a couple years ago... it uses a mask to slowly show a sprite.

    https://www.rieperts.com/games/forum/MummyReveal.capx

  • do you mean the invisible part is always invisible? in the sprite editor you can set the alpha channel to 0 and paint the part of the sprite you want to be transparent...

    or do you mean you need to make part of a sprite that starts off visible suddenly become invisible?

    you could do that with an animation, unless you need the invisible part to move across the sprite... then blend modes is what you need, like jobel said. (you can make a mask sprite that only blends with part of your source sprite).

    if none of the above, then you will have to make an image to show us what you are trying to do.

  • tinbashingstudios - containers are a great way to do this.

    just for future reference here are some other options to remember:

    when you have a rocket selected, you could use "Pick Nearest" to get the instance of particles closest to that rocket.

    another option would be to use "Pick by Evaluate" and pick the particles where the PinnedUID equals the Rockets UID to make sure you get the right one.

    if you weren't using Pin, you could also add an instance variable to particles and store the rocket's UID in that.

  • Event 2 - On Start of Layout you check if energia EXISTS

    but event 1 - On energia GET you read the value

    both should be EXISTS, or GET. The way you have it, the GET will never get called.

    I don't see where you SET energia, so that could be a problem as well...