dop2000's Forum Posts

  • Assuming that layer 0 is not scaled, and layer 1 is scaled, Sprite is on layer 1:

    On every tick -> Sprite set position to

    X: CanvasToLayerX(1, LayerToCanvasX(0, Mouse.X, Mouse.Y), LayerToCanvasY(0, Mouse.X, Mouse.Y))

    Y: CanvasToLayerY(1, LayerToCanvasX(0, Mouse.X, Mouse.Y), LayerToCanvasY(0, Mouse.X, Mouse.Y))

    .

    EDIT 12 days later:

    AM_Games , scrap that! I just remembered that you can easily get mouse coordinates for any layer.

    Simply set position to Mouse.X("layername"), Mouse.Y("layername")

  • You can break the string into tokens and re-assemble again:

    variable newPrizes=""
    For x=0 to (tokencount(Prizes, ",")-1)
     if loopindex=4 : Set newPrizes to newPrizes & "9"
     else : Set newPrizes to newPrizes & tokenat(Prizes, loopindex, ",")
    
    
     // add comma after each token, if not the last one
     if loopindex<>(tokencount(Prizes, ",")-1) : Set newPrizes to newPrizes & ", "
    
  • You can do this with regex:

    Set v to 123456789
    MyText set text to RegexReplace(str(v), "(?<=\d)(?=(\d\d\d)+(?!\d))", "g", ",")
    

    result: 123,456,789

  • You can also try this method:

    1. Convert object coordinates from layer 1 to layer 2

    Sprite set position to
    X: CanvasToLayerX("Layer 2",LayerToCanvasX("Layer 1", sprite.X, sprite.Y) ,LayerToCanvasY("Layer 1", sprite.X, sprite.Y))
    
    Y: CanvasToLayerY("Layer 2",LayerToCanvasX("Layer 1", sprite.X, sprite.Y) ,LayerToCanvasY("Layer 1", sprite.X, sprite.Y))
    

    2. Transfer object to layer 2 and then move it towards the basket, using Bullet or some other behavior:

    Sprite move to Layer "Layer 2"
    Sprite set Bullet enabled
    Sprite set Bullet angle of motion to angle(self.x, self.y, basket.x, basket.y)
    
  • Resizing text objects dynamically is surprisingly difficult.

    You need to make the text field big enough to fit the entire text, then set text. Then wait a little for the system to render it, measure the text using TextWidth and TextHeight expressions. And only then you can resize the text object.

    It's probably better to do the rendering/measuring with a different (hidden from the player) text object. See this post for some examples:

    construct.net/forum/construct-2/how-do-i-18/creating-appropriate-sized-spe-128993

  • "On space pressed" is a triggered event (as all other events which start with "On").

    Never put triggered events nested under some other events.

    So try moving it to the top level, and add "MapWorld is ovelapping event" as a second condition.

  • Put sprite1 on layer1

    Put sprite2 on layer2. In layer2 properties set "Force own texture=Yes".

    Add mask sprite (for example big black rectangle) on layer2, above sprite1. Set "Blend mode=Destination out" on mask sprite.

    Now if you move the mask sprite to overlap sprit2, sprite2 will become invisible, revealing sprite1.

  • Check origin image point and collision polygons. Ideally they should be the same for all animations and frames.

    If this doesn't help, please share your capx file.

  • Or use "Scale outer" and add this frame image to your layout.

  • , thanks! Posting on itch.io is a really good idea! I'll probably do this after I publish the game on Google Play and App Store.

  • Set text to Array.At(Array.IndexOf("rabbits"), 2)

    Text should display "3"

  • , Thanks a lot for the feedback!

    How long did it take to load? 10-20 seconds or longer?

    The size of the game is about 30Mb, and it's hosted in Australia (which is famous for its crappy internet speeds), so maybe that's why it's loading so slow. It should definitely be faster once installed on the phone.

    Planets rotation is intentionally made to be one step at a time, because each step uses 1 energy and the energy is the most important resource in the game. If I allow to rotate planets freely, without stopping after each step, the energy will be drained really quickly.

    When you see 3 yellow planets scattered far away from each other and you start bringing them closer, you will quickly realize that this is not the best tactics, as you are losing too much energy. So you have to be creative and plan your moves.

    The game is going to be free with IAPs and ads. But there is no "paywall", it can be played without spending money. When testing I completed all 200 levels several times without making a single purchase.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you build a graph with those values you provided, you'll see that it looks similar to y=1/x function. Only instead of "1" there should be a much bigger value.