TwinBlazar's Recent Forum Activity

  • 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?

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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?

  • Questions:

    1. since the Wii U got only 2 GB RAM, does C2 manage resources more carefully on Wii U? (I recall seeing my game eating almost 1 GB after several hours of consecutive play) Does the console simply crash if you used up all the console's memory?

    2. For bigger games, do you have to optimize or do anything extra for Wii U?

    3. Performance-wise, how do your C2 games run on Wii U compared to modern desktop using Chrome on Windows with mid-end GPU like GTX 750? (I heard some article claimed Wii U only has the strength similar to the old ATI 48xx card) How well does it run your C2 games?

  • There are several ways you can do this, and this also depends on your sprite images too.

    Do you want to use 2 objects (enemy image and spear image) or 1 object (a single image that has an enemy holding the spear) ?

    Can you show us all frames and images of this particular enemy? This is so we know what kind of events you need.

  • If I understand you correctly, you have an enemy that has spike shield and player must kill it by stomping it from above?

    Something like this enemy? See 1:20 of this video https://youtu.be/ZJuxdR0KH-s . The enemy with spike at the top?

    Please confirm if this is what you want.

TwinBlazar's avatar

TwinBlazar

Member since 14 Apr, 2013

Twitter
TwinBlazar has 1 followers

Connect with TwinBlazar

Trophy Case

  • 11-Year Club

Progress

11/44
How to earn trophies