AllanR's Recent Forum Activity

  • the bottom edge of the image might be seamless with the top edge, but when you set the position back to -50 the part of the image that was visible (near the top) is not seamless with the part that becomes visible at -50.

    you will either have to change the image so that the "seam" is at the point where it scrolls on at -50, or you can use two instances of the image and move the lower one back up over the other one when it gets to correct point (and move both down every tick).

  • I also never use Tap.

    I like to create an invisible sprite on every touch start (and then destroy it when that touch ends). The sprite object has instance variables to track where the touch started, how many ticks it has been in touch, objectUID it started on, etc.

    then it is easy to tell if it was a tap, or a swipe, and helps make sense of multi-touches...

    For buttons, I don't execute the button code until the touch end. That way if you change your mind and slide the touch off the button, it doesn't execute - which is more intuitive and consistent with other UIs.

  • You do not have permission to view this post

  • as long as that is all happening inside the loop, the new instance should picked, and I would expect that code to work...

    have you defined the size of the array? can you post a sample file to look at?

    if you are creating array instances to go with something else, another thing you can do is make a "Profile" container object, and put an array object in there - that way the array automatically gets created when you create the Profile object, and it selects the correct one when you select the Profile object.

  • I tried it and got the same result as you, so I imported a random sound from my computer, and it worked fine with your code, so I think it is a problem with your sound file.

  • the second last event sets your variable to 1, and then the last event sets it right back to 0.

    you need to use an "Else" to prevent that from happening:

    	Keyboard on Space Pressed
    		Sprite obrot = 0 	: Sprite Set obrot to 1
    		else			: Sprite Set obrot to 0
    
  • since we can't see much of your code, it is hard to say...

    does the textDebugging list all the enemy IDs? If the enemies were just created, they will not be pickable until the next top level event.

    or if this is a subevent that has filtered the enemies, they may not all be selected (then you would have to use a Pick All before your loop.

  • You do not have permission to view this post

  • You do not have permission to view this post

  • the easiest way to make sure you get unique results, without repeats, is to put all the possible numbers/strings in an array. Then pick a random entry out of the array, and delete that entry so it can't get picked again.

  • the fact that it was close was more luck than anything...

    the place where you set the slider's position - you were including BrowserSliderMainPart.Height but its height is zero because you replaced it with 9patchSlider.

    the first part of that calculation (scrolly-(1080/2))/LayoutHeight) only works out to 0 to 0.5 because scrolly goes from 540 to 1620. to get it to go from 0 to 1, either multiply that result by 2, or change it to (scrolly-(1080/2))/1080)

    but that assumes the layout height will always be 2160. If you want the scrollable area to be variable, it gets a little trickier. Either you have to change the canvas size as required, or use unbounded scrolling and manually control where scrolly starts and stops.

    the second part of the above calculation needs to factor in the height of 9patchSlider, so the over-all calculation would be something like:

    (((scrolly-(1080/2))/LayoutHeight)*2*((1080-9patchSlider.Height)-179))+179

    or

    (((scrolly-(1080/2))/1080)*((1080-9patchSlider.Height)-179))+179

  • how would it know which one to delete? The last one created? one you clicked on? a random one?

    there are lots of ways to "pick" a single instance, and then it will only destroy the one you picked. But it is up to you to tell it how to pick just one instance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies