99Instances2Go's Forum Posts

  • 1/ Event 4 can never ever pick a Sprite that is not var from a previous picked list (in event 1) that only contains Sprite that is var.

    2/ 'or' is a logical operator. It does really filter the picklist.

  • Limit the swing. Using clamp(n, lower, upper).

    Easy to adapt if you build that .capx

  • They are not on the same layer. The player and its collection area are on a different layer then the dots.

    The layer with the dots is rotated, the layer with the player is not rotated.

    Not saying that it is your only problem. Test your original project as follow. Rotate the layout, in stead of 1 layer. Just to test. Did it solve the problem, then it is the only problem. Did that test did not solve the problem, that there is something else also acting up.

  • Well, this (particular one) is easy to do in the image editor.

    Open the sprite in the image editor. Window showing the animation frames should pop up too.

    Assuming that there is only 1 frame.

    Right click that frame .. choose Duplicate. Select that duplicated frame.

    Select the Rectangle Tool in the image editor, Right click/drag the first line of pixels away.

    Right click that frame in animation window .. choose Duplicate. Select that duplicated frame.

    Select the Rectangle Tool, Right click/drag the first line of pixels away.

    and so on .....

    Reverse the frames.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Lets breakdown event 3 (and further) down.

    The 'Every tick' is not needed.

    The conditions read as follow ....

    'For each' runs trough every Sprite. Each run it picks 1 Sprite.

    So at any point in the iteration, the picklist now contains 1 Sprite.

    Event 4 starts picking from that (previous picked) picklist.

    It picks from that picklist all sprites with id = 1 and clicked = 1.

    The result is a new (refined) picklist. If that new picklist is empty, the conditions marks as untrue, and will not run its sub events, it will not run its actions.

    Lets assume that this new piclist is not empty at one point in the iteration.

    Or, lets assume that there is a Sprite with id = 1 AND clicked = 1.

    Now event 5 start picking from the (previous picked) picklist (in event 4).

    That previous picked list can only contain Sprites with id = 1. No others. Hence event 5 can never ever pick a Sprite with id =2 from a list that only contains Sprites with id = 1.

    Event 5 will never ever run, its picklist is always empty.

    Event 6 is a sub. Not only has it the same problem. It is also a sub under event 5. Since event 5 can never ever run, event 6 is never ever reached.

    Plz read this:

    https://www.scirra.com/manual/75/how-events-work

  • I not gonna fix this in your project. It is to complicated for me, and i see things that i dont understand.

    Like that 'for every zero seconds' every where in the events. Like all those duplicate key triggers.

    But i gonna do my best to explain what is happening. So you can fix it yourself.

    You have an object on a rotated/parallaxed layer, and you want to move it towards a position on another and different rotated/parallaxed layer. In your case different means not rotated/parallaxed at all for the second layer.

    Lets explore this.

    https://www.dropbox.com/s/hd03y47rwdzp4 ... 1.c3p?dl=0

    In this .c3p i present you 2 layers. On each layer you find a sprite representing a coordinate system. A coordinate system is just and no more then a way to describe where a certain point is. That point is so much units on the X axes and so many units on the Y axes.

    On each layer you also see a sprite on 6 units on the X axes and - 6 units on the Y axes. That sprite is named 'marker'.

    Now press U on the keyboard to rotate layer 0. You see that the non of the markers is changing position towards there coordinate system. Both still sit on 6 units on the X axes and - 6 units on the Y axes. Yet they are not on the same position on the screen.

    The Coordinate System for layer 0 changed. (well it rotated). So now both markers live in a different world. You can not longer say that the marker on layer 1 sits on 6 units on the X axes and - 6 units on the Y axes in the the coordinate System for layer 0.

    Next c3p.

    https://www.dropbox.com/s/bql5dufygbphj ... 2.c3p?dl=0

    Now i added two sprites named 'PlaceOnLayer' plus a number to represent on what layer that they are.

    And both layers are rotated.

    Now clearly if we set 'PlaceOnLayer0' (that object is on layer 0) to the position of 'markerOnLayer1' (that object is on layer 1), IT ENDS UP on the position where 'markerOnLayer0' sits.

    That is because if you position something on layer 0, the position is calculated with the coordinate system on layer 0.

    So we have to invoke terrible math to translate coordinates (X&Y) from the coordinate system in layer 0 to the coordinate system in layer 1.

    Luckily c3 (and 2) has Math Expressions that do all the work for you. Those expression are

    LayerToCanvasX & LayerToCanvasY

    and

    CanvasToLayerX & CanvasToLayerY

    https://www.dropbox.com/s/7267s27vargan ... 3.c3p?dl=0

    We can not straight translate from a coordinate system on layer 0 to that on layer 1.

    We have to do it in 2 steps.

    First we use LayerToCanvasX & LayerToCanvasY. Those expressions translate an X/Y coordinate on a certain layer to the coordinate system of the screen (Canvas).

    The screen is never ever rotated/parallaxed, so it has always a default and known coordinate system. We just use it to temporally push our rotated/parallaxed X/Y in a known steady world.

    Secondly.

    We use CanvasToLayerX & CanvasToLayerY to fly those coordinates from the that steady world coordinate system to the coordinate system on the other layer.

    So its.

    Step 1 .. use LayerToCanvasX to translate a X on a rotated layer to a non rotated world.

    Step 2 .. use CanvasToLayerX to translate the X on the non rotated world to another layer.

    In the previous .c3p you see this happening using 4 local variables.

    But it can also be done all at once in 1 action:

    https://www.dropbox.com/s/4c9r3fjk87g5k ... 4.c3p?dl=0

    Hope my English was good enough to explain this. Sorry if not the case.

  • You scaled those blocks, wonder how you gonna replace them with blocks hand drawn with 1 to 1 ratio.

    I accounted for that (i think).

    https://www.dropbox.com/s/vwha0ih9ouyhy ... .capx?dl=0

    But. Dont think i would use a family for this. Later on you gonna make levels.

    Levels = different graphics & probably different amount of platforms to choose from.

    Got the feeling that it will be easier to use 1 instance with all the graphics in.

    For each level a different animation.

    For each platform a different frame.

    Talking performance, if you gonna make a lot and huge hand drawn clunks, they will bite back.

  • C2 just did not autocomplete at all.

    C3 auto completes with only system expressions. Guess that looks like a bug.

    Work around it by first typing MyObject.SomeValue.

    The type the (3) in between them to get MyObject(3).SomeValue (with auto complete)

    But be aware of this. That value between the ( ) is the IID (it is in c2) for all items, whatever is picked.

    Unless the loop runs trough ALL instances in the SAME order as they are created, it has no function.

    -------------------------- <---- no pre-picking

    For each MyObject <- runs trough them in creation order

    Compare two values ... first = MyObject(loopindex).SomeValue =? second ... 5

    Compare two values ... first = MyObject(loopindex + 1).SomeValue =? second ... 5

    Compare two values ... first = MyObject(loopindex + 2).SomeValue =? second ... 5

    __________ Actions

    To test if 3 consecutive SomeValue's are = 5 ...

    Works flawless.

    This will not work

    Is on Screen (MyObject) <-- prepick

    System: For each MyObject order by MyObject.?X ascending <-- & wrong order

    Compare two values ... first = MyObject(loopindex).SomeValue =? second ... 5

    Compare two values ... first = MyObject(loopindex + 1).SomeValue =? second ... 5

    Compare two values ... first = MyObject(loopindex + 2).SomeValue =? second ... 5

    __________ Actions

  • Did you perhaps forget to make the moving platforms 'solid' ?

  • it would be very easy to point out when the box has to stop on a sprite with "solid state".

    How would you program that ? (pseudo algorithm)

    Keep in mind that at 60 FPS and a speed of 600 pixels/second, the sprite moved 10 pixels between between 2 ticks. Keep in mind that you, in reality, dont know the FPS for every targeted device.

    PS It is possible in c3 with its improved steps on the Bullet. But i dont understand steps yet.

  • Ohh you are right.

    x = Button.RestPositionX + (choose(1,-1) * (ScalarX * ((random( (max((1 - (1 / Button.LineOfSight.Range)),0) * (distance(button.x,button.y,mouse.x,mouse.y))) , 0 )))))

    y = Button.RestPositionY + (choose(1,-1) * (ScalarY * ((random( (max((1 - (1 / Button.LineOfSight.Range)),0) * (distance(button.x,button.y,mouse.x,mouse.y))) , 0 )))))

  • see if you put an event that when the BOX collides with the wall adds 1 to a variable X. If you do it you will realize that when you go with the BOX against the wall the value of the variabe does not rise by one and then it stops but it also rises by 3/4 units if I hold down the key to send the box to the bottom <img src="{SMILIES_PATH}/icon_neutral.gif" alt=":|" title="Neutral">

    Some comments about that remark.

    Of course that's what is gonna happen. It is impossible to stop exactly there where the wall is.

    For 1 reason: You are Human.

    The 8direction stops at solids as follow. When it overlaps a solid, it pushes the sprite back to from where it came from until it is not overlapping the solid no more. The famous Push-Out-Off_Solid_Routine.

    So what happens. It hits the wall. The push out happens. You are still pressing the key, so it starts accelerating again. You literally push it back into the solid. It hits the wall. The push out happens again. And so on, for a few ticks.

    Set up that construction that you describe, run up against the wall, see the variable go up every time you press the key when just leaning against the wall.

    Still dont believe me ?

    Set the acceleration to ridiculous high. Now the variable counts only 1 collision when you run in to the wall. But, the sprite ends up way off the wall. Meaning, the push-out had to push it out to much.

    Set the acceleration back 600. Set the Deceleration to 12 or so. Now move towards the wall. But lift your finger before it hits the wall. When it now hits the wall, that variable is registering only 1 collision. Prove that it is your finger and only your finger.

    Do i like this behaviour? No, not at all. Can it be changed ? I dont think so.

    Some things happen before the start of a tick. Other things happen after the end of the tick.

    The push-out happens before the start of the tick, because you need the position of that sprite in all the events.

    The acceleration (unattended behavior thing) happens after the end of the tick, before the drawings.

    Is it easy to work around? Nope, not that i know. But, hey, i am for sure not a c2 pro.

    You can limit the keys, like in this example.

    And if you are careful with positions and sizes, you can even snap to a pixel, as in this example.

    https://www.dropbox.com/s/ecbn35mqsnln4 ... .capx?dl=0

    But i dont think that it is totally flawless.

    Bottom line ....

    If you want pixel perfect games, you better might forget making video games. Those games are linked to a frame rate, and the sample rate that comes with it.

    Second bottom line.

    When you need a pixel perfect game, you are better of scripting EVERYTHING. You can not use pre-made behaviours at all. And i can not help you with that. Really sorry (4 myself).

    Edit: i see that there are new posts, posting anyway.