TwinBlazar's Forum Posts

  • In that case, just create appropriate colored images, put each color separately into different animation of your Object sprite (ex. red image goes into "red" animation, blue goes into "blue", etc.), and set the appropriate animation accordingly in each Object in order.

    This way, it is like model view controller (google it up). You leave your logic be with those numbers comparison while leaving these colors separately from logic. The benefit is, suppose you wanna change color or want to change the whole charade to some other "visuals" completely, you can do so without modifying the events.

  • Upgrade the object using object type in array? So are you gonna destroy the original object and create the upgraded version in the original's place? Something like this?

  • There are several ways to do this and here is one possibility:

    From https://www.scirra.com/manual/132/common-actions

    [quote:34mv0gqp]Set angle toward position

    Set the object's angle to face a position in the layout.

    Bullet on created: set object's angle to face (player.x, player.y)

    If your Bullet behavior has set angle on, your Bullet object should head toward the player right when it is created.

  • Ashley, is it possible for the future release to be able to provide SaveStateJSON without acquiring it only from the trigger "on save success"?

  • Your computer is fine. The fluctuation of framerate is common and it happens once in a while, not only for C2 games, but also other games using some other engines too.

    Also, framerate is updated once every second only. Perhaps a frame got a tiny hiccup, that's why it got 57 fps. But this is negligible, I'd say.

    I believe one of the possible reasons for this framerate drop is Garbage Collection: https://www.scirra.com/blog/76/how-to-w ... javascript

  • It is likely that you can't. I used to ask about virtual keyboard customization and the answer I got is pretty much "make it yourself":

  • Can you tell us first what are you trying to accomplish? Why do you want to pin a hexagon to another hexagon? What is your big picture? What is this seemingly puzzle game all about?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For endless type of map, I would prefer the player to stay in place and keep on spawning all obstacles and sending them to the player until the player is dead.

  • How about using an array and on the start of the layout, you put all of your wall's UID into the array? (use "For each" loop)

    See https://www.scirra.com/manual/108/array . If know the size of the array, you can pick a random index from the array with respect to its size and remove one randomized UID from the array. Then, pick a wall by its UID using UID number you acquired from the array. Now, set this picked wall to be visible and solid.

    Note: Also when you removed an element from the array, please check whether all the elements succeeding it are shifted up in index like in Linked List or not. I forgot whether this is the case or not. This is so that you can see whether you have to sort the array after removing an element or not.

    Do you follow or do you need further assistance?

  • If that is what you want, perhaps you may wish to move the player without using behaviors. And use events instead.

    For example,

    if left key is hold : set player's x to player.x - 100*dt

    else if right key is hold : set player's x to player.x + 100*dt

    else if up key is hold : set player's y to player.y - 100*dt

    else if down key is hold : set player's y to player.y + 100*dt

    From these events, the player can only strictly move in one direction.

    Is this Yes, No, ok?

    EDIT: the above events will move the player in a very stiff fashion - not good aesthetics-wise for some games and perhaps your case.

    You can remedy this by:

    if left key is hold

    if upAccelerate <= 0

    if downAccelerate <= 0

    if rightAccelerate <= 0:

    add 100*dt to leftAccelerate

    set player's x to player.x - leftAccelerate*dt

    else

    if right key is hold :

    f upAccelerate <= 0

    if downAccelerate <= 0

    if leftAccelerate <= 0:

    add 100*dt to rightAccelerate

    set player's x to player.x + rightAccelerate*dt

    ...

    ...

    do the above for up and down direction

    ...

    ...

    every tick,

    subtract 50*dt to leftAccelerate

    subtract 50*dt to rightAccelerate

    subtract 50*dt to upAccelerate

    subtract 50*dt to downAccelerate

    Is this what you want?

  • You may wish to see this plugin

    From there, see this?

    [quote:2417335v]date in a row plugin, Get continuous date count.

    Does this fit your bill?

  • ok,

    [quote:3o5mx22n]You need to assign a variable into the object player needed to collide with. You assign variables of these objects in a running number. (ex. 1st object created is assigned 1, 2nd object is assigned 2, etc.)

    First, let's take care of the variables.

    Create a global variable called "runningNumber" and give it value of 1 in your event sheet.

    Create an instance variable for the object and call it indexNumber, set default value to 0.

    [quote:3o5mx22n]You will also need to assign a variable to the player and assign a number that player needs to go for. (in the case, the 1st object, which has the variable value of 1, so you assign 1 to the player's variable, too.)

    Since you want the player to go for the objects in the order they are created. We need to assign a number to these objects when these objects are created.

    In the object's On Create event, set the object's indexNumber to the global variable runningNumber. Then, add 1 to the global variable runningNumber.

    Why add 1 to the global variable runningNumber? This is so whenever another object that the player has to go for is created, it will have the succeeding number. (For example, when the first object is created, it will have indexNumber set to 1, the second object will have indexNumber as 2, and so on.)

    [quote:3o5mx22n]When the collision occured between the player and the object, you checked for the numbers of both the player and the object. If both numbers are the same, you can destroy this object and assign the next number the player needs to go for, in this case 2. Else if the numbers are not the same, game over.

    Now, the main crux. We have these objects created and each of them have indexNumber assigned in sequential order by the order they are created.

    Create an instance variable for the player, call it "nextIndex" and assign it a value of 1.

    Now, create a collision event for the player colliding with the object. In this collision event, you will check for the player's nextIndex and the object's IndexNumber. If these two numbers are equal, it means the player is touching the right object. Else, the player is touching the wrong object.

    From this logic, you can create Collision event like this:

    Player On collision with Object

    > if Player.nextIndex = Object.IndexNumber : > > > Add 1 to Player.nextIndex

    > > Object destroy

    > else

    > > Player destroy

    The first time the player collides with Object, if the object has IndexNumber of 1, which is the same as the value of the player's Nextindex, this implies the player is touching the first Object correctly. If the object the player touches does not have IndexNumber of 1, the player touches the wrong object and will be destroyed.

    Why do we put "Add 1 to Player.nextIndex" there? This is because the next Object the player should touch is 2. And the same logic from above can be applied. The player will survive as long as he keeps on touching the correct objects using these incremental numbers, but the player will be destroyed if he touches the incorrect object.

    Is this explanation better?

  • If you have just one image object, you could refer to the animation name currently being played and applied logic accordingly.

    Quote below is a Sprite condition referenced from https://www.scirra.com/manual/115/sprite :

    [quote:h18t4v7u]

    Is playing

    True if a given animation is currently set. Animations are identified by their name (case insensitive).

    For example,

    player collided with enemy:

    > if player.y < enemy.y:

    > > if enemy is playing "isHoldingSpear": player destroy

    > > else : enemy destroy

    > player destroy

    Something like this. You need to make sure the events go into the right "block" too or else this will not work correctly.

    Unfortunately, I am on smartphone and it will be a long while before I can get back to my laptop. Can someone in the forums provide him a capx for the time being?

    [quote:h18t4v7u] I have seen his game Project Dimentia Bodhisattva I really liked good job

    Thank you. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • You need to pick that particular object first.

    Suppose you have a collision event, this will pick the instance of object A and the instance of object B that are colliding with each other. In this collision event, you can set, for example, time scale on the individual object B.

    See https://www.scirra.com/manual/75/how-events-work for more info on how picking works on C2.

  • bump.

    If there are no solutions to save failure yet, perhaps I will need to go for password route. A bigger Flash RPG game such as Phoenotopia also did this as several people lost their saved data on their browser. Password is put into clipboard and player can save it somewhere. Player can then paste the password on the game's continue screen.

    From the look, I believe Phoenotopia simply uses some encryption algorithm to encrypt the whole save data and make that a password.

    But for C2, if the save failed, I will not be able to retrieve the save state json at all... the last resort would be going down and dirty myself...

    Another problem is putting data into clipboard. I see from another thread answered by R0J0hound that only Node Webkit can do clipboard stuff as it is OS-specific thing.

    Are there other things I can do to store data or give data to the player?