TwinBlazar's Recent Forum Activity

  • Why don't you just create another gray box when the text appeared?

  • From the manual on gamepad:

    [quote:124ddlv2]Most mobile devices do not have a physical socket to connect a controller to. Therefore Gamepad input can usually only be used with desktop computers. For mobile devices with touchscreen input, focus on designing touch controls.

    Still, nowaday, there are bluetooth joysticks that allow you to play a few games that support gamepad.

    Nevertheless, have you tried C2's gamepad plugin and tried run the game on the smartphone? Does the game respond to the gamepad input?

  • What platforms is this game to be played on?

  • When you said "heavy", how many Megabytes are we talking about here? Are they actually negligible by modern system?

    I'd say stick to the method you are most comfortable with until it no longer works.

  • That else there only works when CurObjet is not 151 because it is only followed by that CurObjet = 151 clause.

    To do what u want, add another else at the CurObjet = 151, so

    CurObjet = 12

    ...

    else

    CurObjet = 151

    ...

    else

    ...

  • Hi guys,

    Is there a max game save size on Node Webkit?

    From https://www.scirra.com/manual/188/local-storage :

    [quote:6g546lpw]

    Storage quotas

    To prevent abuse, most browsers implement a storage quota, which is a maximum amount of data that can be saved locally. On most modern browsers this is at least 50mb. If the quota is exceeded, the On error trigger will fire.

    But on NodeWebkit, what is the limit and can it be increased? Does this also affect the built-in save feature of C2 or is it a separate storage?

  • One possibility:

    You have to create an image for all numbers 0-9, and also create images for when the numbers are rolling. Do you want just several frames of quick speedy animation (which the player couldn't see what the number is) OR do you want to create the frames showing the gap between each number? This is all entirely up to you.

    You will have a Sprite called "Digit" which has 2 animations: "stillNumber" and "rolling".

    "stillNumber" will have 10 frames, frame 0 has number 0. Frame 1 has number 1. And so on until 9.

    "rolling" will obviously have the frames of rolling numbers.

    Create an instance variable called "index" for the Sprite Digit. Now, clone the sprite until you have 6 instances of sprite Digit. Line them up in a row just like what you posted. From the rightmost Digit to the leftmost Digit, assign a running index value starting from 0 to 5 to its variable "index". So the rightmost Digit will have "index" of 0. The second rightmost Digit will have "index" of 1. And so on, until the leftmost Digit which will have "index" of 5.

    In the event sheet, you will refer to each Digit using the variable "index", using For Each (ordered). You will have to refer to the number variable you want in this loop and pick out the particular digit from such variable. You can acquire just the nth digit of an integer variable by dividing it by 10^(n-1), floor the result and do modulo operation (%) on it with value of 10. For example, getting the 3rd digit of 98765: floor(98765 / (10^2)) = 987 --> 987 % 10 = 7. Thereby, you get number 7 which is the 3rd digit of number 98765. From here, you can map these values you get with the "stillNumber" animation frames.

    However, one part still remains and that is the rolling part. The paragraph above is simply for mapping number to be shown correctly, but for aesthetics of rolling number, suppose the integer variable you are referring to is changing, you could make it so the Digit changes its animation to rollingNumber for a brief moment before turning into "stillNumber" animation once again. But for this part here, how the rolling numbers should look like exactly when the referred variable change around is entirely up to you.

    Follow everything so far?

    -----

    Above is just one possibility, and it has its own pro and con. But does this fit your bill?

    Also, if anyone can come up with something simpler, please do share.

  • TiledBackground? Are you using only 1 TiledBackground object and extend it long? In that case, you will still have only 1 TiledBackground to collide with.

    Can you tell us your big picture? What are you trying to achieve?

  • Do you want the numbers to give impression of rolling up and down just like what you posted too?

  • In the case that all of these objects that could be drag around and all other objects you are testing for nearest distance are the same object type, I suggest you to create an invisible sprite on the object you are dragging, and refer to the code above using the invisible sprite in place of ObjectBeingDragged. This is because all those object picking is quite problematic when you have to refer to an object to another object that has the same object type.

    If you are doing the paragraph above, one of the thing you must also take care of is to eliminate the first nearest instance as you are creating the invisible sprite on the instance you wanna test on, and the first nearest instance actually has become the object you are testing for. Because of this, it must be excluded. So now, to look for 1st and 2nd nearest instances, you must now look for 2nd and 3rd nearest instance in the event sheet.

  • Picking n nearest instances? You may wish to mix "For Each (Ordered)" with distance formula:

     For Each EnemyObject order by distance(ObjectBeingDragged.X, ObjectBeingDragged.Y, EnemyObject.X, EnemyObject.Y) ascending [/code:ozycgyqb]
    
    This will iterate to all of your EnemyObject instances starting from EnemyObject nearest to ObjectBeingDragged in the first iteration, then the second nearest in the second iteration and so forth.
    
    Since you only need 2 nearest objects, you could go for something like:
    
    [code:ozycgyqb] 
    
    set global variable i = 1
    For Each EnemyObject order by distance(ObjectBeingDragged.X, ObjectBeingDragged.Y, EnemyObject.X, EnemyObject.Y) ascending 
    
    

    if i = 1:

    > set global variable uid1 = EnemyObject.UID

    if i = 2:

    > set global variable uid2 = EnemyObject.UID

    > stop loop

    add 1 to global variable i

    [/code:ozycgyqb]

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You are new to this? Have you seen https://www.scirra.com/tutorials/37/beg ... onstruct-2 This is the basic foundation of C2 that you must understand before attempting to make anything else.

    [quote:1nj9zaac]but now the coin sometimes doesn't show on the layout.

    EDIT: just saw your edit. Can you check for the location of the coins? See Debug Preview and check where are the coins. (...or are there no coins?)

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