TwinBlazar's Forum Posts

  • What browser are you using? Does it affect all browsers?

    I used to run into something similar when I save state the game on Firefox preview. The issue does not occur on Chrome and also does not occur on Firefox if I play the game exported as HTML5 site and uploaded to a server.

  • Why do you want to scroll back to where you keep them? You forgot their names?

    For me, if I have lots of global variables to be used and referred to, I will just use Snipping Tool to snapshot all those global variables, place the snapshot on the left side of the screen and place C2 on the right side.

  • I'll give you a little hint: First, just create one object, give it variable centerx = 300, centery = 300, radiusx = 100, radiusy = 30, angle = 0

    every tick for the object, do this:

    set angle = object.angle + 360*dt

    set x = object.centerx + object.radiusx*cos(object.angle)

    set y = object.centery + object.radiusy*sin(object.angle)

    Now, run it and you should see the object spinning around in oval manner centered at 300,300. Now, imagine for loop for many objects... does that ring any bell?

  • does fit your bill?

  • From the image, I am assuming you wanna the planets to be rotate around in circular like Rotary Dial telephone.

    One possibility is to use this math formula:

    x = centerx + radiusx*cos(angle)

    y = centery + radiusy*sin(angle)

    Read more: http://www.themathpage.com/atrig/unit-circle.htm

    Once you understand what these formulae do, you could extend it with for loop to loop through your planet and move these planets in circular motion.

    Do you follow?

  • I think the auto-complete is fine for this. Beside, if you organize all those variables well, you should not have any trouble.

    Can you provide a use case that might show the benefit of your suggestion?

  • How about you show us your capx or event sheet so we can investigate what went wrong?

    If you wanna post links, since you have less than 500 reputation, any of your posts with links will have the links removed. To remedy this, make it so your link doesn't look like a link. Ex. change "http://www.abx" to "tp:www.abx"

  • I assume you are pausing with timescale setting to 0 and set object timescale for player object to 1.

    In the event sheet, what you wanna do is to create a global variable "pause". When you pause, set "pause" to 1, and 0 when unpause. You will then add additional condition "if pause = 0" for all player's input. This is for normal game pause.

    Now, for when the player dies, create another global variable "deathpause". Set it to 1 when player dies. Adds this variable as another conditional check "deathpause = 0" to all appropriate places such as when the player sprite might change animation (This is all up to your game.). This is so the animation won't change if player is already dead. Also, dont forget to set "deathpause" back to 0 when the player respawns.

  • The above post is a naive implementation and it uses 2 TextBox objects. (TextBox1 and TextBox2) If you have 20 TextBoxes, having TextBox1, TextBox2 up to TextBox20 would work but it is ugly. You could go naive and create them like TextBox_Line3_Column1, Textbox_Line3_Column2 and Text_Line3. This works... but if you have to create 100 of lines, creating 100 lines manually would be hellish work.

    If your requirement is just that or if it is unlikely to change later, you can just go with the paragraph above.

    A more practical approach to iteration would be to have just 1 TextBox object, create many instances of them (copy and paste them) and refer to them using for loop and variables. The same goes with the Text object.

    So instead, for the 7 lines, what I would do is to create a variable for the textbox and text object. Let's call it "LineNumber". Once you arrange those TextBoxes and Texts on your layout to be in the correct order, you set LineNumber for each TextBox and Text instance accordingly to the line they are on. For example, line 1 instances have LineNumber set as 1, etc. For the textbox instances, you will also need another variable called "column". For the Textbox instances on column 1, give this value of 1. Do the same for Textbox instances on column 2 but give them value of 2.

    In the event sheet, you can do something like this:

    global variable sum = 0

    for i = 1 to 7,

    set sum = 0

    TextBox of variable Column 1 and LineNumber i: add int(TextBox.text) to sum.

    TextBox of variable Column 2 and LineNumber i: add int(TextBox.text) to sum.

    Text of LineNumber i : set text to global variable sum.

  • see the textbox tutorial: https://www.scirra.com/tutorials/624/te ... le-textbox

    Let's go slowly for what you wanna do. First, let's just have only this:

    (stat 1) (Stat2) and (fixed number)

    one line and 3 numbers.

    For stat 1 and stat 2, you can use TextBoxes there. For the fixed number, you can use text object. These are taught in the link above.

    Also, from the tutorial above, you also learn how to treive the value from the textbox. If you have two textbox objects, for example, TextBox1 and Textbox2, you can refer to the texts inside the textboxes with TextBox1.text and TextBox2.text.

    For the sake of simplicity, in the event sheet, you can use "every tick : set text object's text to int(TextBox1.text) + int(TextBox2.text) .

    This will make it so the value of text object will be set to 2 values of the Textboxes being added up every tick.

    Do you follow everything so far? If so, I will proceed for 7 lines just like you want.

  • I don't know how does that sprite pack look like. A link would be nice. So I am assuming you have an animation for each 45 angle for your sprite. (Correct me if I am wrong.)

    But I believe you will need to use events to apply for all those animations you want. For example, for each 45 degrees angle of your animation strip, you could create animation named "player1_0", "player1_45", "player1_90", ... , "player1_315". Then, from the player's input (touch, keyboard, etc.), you set the animation with respect to the input. For example, if player is heading toward the right, set animation to "player1_180".

    This is the gist of it but of course, there is also animation speed you need to take care of. For example, if player stops moving, set animation speed to 0. If player moves, set animation speed to more than 0. (You need to find a sweet number with respect to how your animation looks)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There is not enough information. Since you mentioned

    [quote:2boxnoh7]generate level from that array

    How about you tell us first what kind of game you are trying to make? What kind of fabulous experience are you trying to craft? Or else, we might not be able to help you validly.

    But on the primitive level, you could store number or text in the array and then refer to these values to create certain specific objects when you wanna generate the level. You have to define all these yourself. I don't think there is a much of a formula you can look for.

  • create a global variable isSlowMo = 0

    Suppose you wanna toggle slowmotion with spacebar.

    if keypress spacebar:

    if isSlowMo = 0

    > set global variable isSlowMo to 1

    > set time scale to 0.5.

    else

    > set global variable isSlowMo to 0

    > set time scale to 1

    This event will toggle between normal time and slow motion by pressing spacebar.

  • [quote:31usw50k]I have tried reducing volume and the restoring. The music it never plays after reducing or stopping play.

    Music is never played or is the volume so low that it is inaudible? Check for Audio object in "debug preview" for all sounds currently playing. Is the sound being played?

    Also, please follow bug report guideline and provide us a capx. Not only this will help us to work faster, this will allow your report to be taken care of faster.

  • C2 can't create instances from text string but you can do so with Nickname plugin: and store the name of your objects in text in the array. Then, refer to these text and create objects with respect to your plan.