InDWrekt's Forum Posts

  • I also want to say, as with most questions, there are multiple ways to do what you are trying. For example, if you want more control over the color, use individual variables for each of the red, green and blue inputs. Then when you call the set font color, just plug these values into the inputs of the expression.

  • drive.google.com/file/d/1tve8LYP4A-8zaGQ_TZrij61jZj2jmbDz/view

    Ok, you are trying to store the rgb expression itself in a variable. What you need to do is store the resultant value. Check out this example. It sets the value of an instance variable called Color on the text object using the rgbEx expression. It then uses that variable to set the font color. Remember, it is not the rgb expression that is important. It is the value that the expression returns. That value CAN be stored in a variable.

  • Of course there is. It's just a couple sin and cos functions. To get the circle to start at the top we need to rotate it by 180 degrees so we add 180 to the value inside the functions. To get it to fill clockwise instead of counter clockwise, we just need to invert (multiply by -1) the value inside the function.

    sin(-1 * (value + 180))

    cos(-1 * (value + 180))

    Here is the modified example.

    drive.google.com/file/d/12DTzuTArnmAPlzMk6DOdKBqUIbC5Gl92/view

  • Don't extract the the file. it should stay as a single file. When you download it, it should have a .c3p file extension. If it downloads as a .zip, just change the .zip to .c3p. In Construct, use the open local file option.

  • Have you used one of the rgb expressions? These expressions are built so you can just plug in values representing the amount of red, green and blue to blend to get your desired color.

    rgba(r, g, b, a)

    rgba255(r, g, b, a)

    rgbEx(r, g, b)

    rgbEx255(r, g, b)

    For these expressions, r is for the red value, b is for the blue value and g is the green. In the 2 expressions not ending in 255, the value should be between 0 and 100. In the 2 expressions ending in 255 the value should be between 0 and 255.

    The a is for alpha and should be a number between 0 and 100 where 0 is completely transparent and 100 is completely opaque.

  • You do not have permission to view this post

  • Also, if you could post the error message you are getting when trying to open the project I might be able to figure out how to solve it.

  • I built the project in the current stable release (r218) of C3. Is that what you are using to try to open it? There are no plugins so there shouldn't be anything preventing you from opening it.

    Yes, I was able to open yours but I didn't really take any time examining it. I wanted a clean example so the code would be clear.

    I understand that you want the "Enemy" to move but that doesn't change anything. "Player" or "Enemy" are just semantics and the code is all the same.

  • I'm not sure if the is the BEST way to do this because I have never taken the time to build a hex-based game in Construct but since I noticed this topic has been here for a while without an answer, I figured I would try my hand at it. The attached example uses a dummy object with the path finding behavior to set the path of the red character. The hexagon object has the solid behavior but it is disabled where the player is allowed to travel. To Ensure the character can only land on empty spots, you need to enable the solid behavior of occupied spots and regenerate the obstacle map.

    Also, you will notice a bunch of disabled events/actions. If you enable them, the player movement will be restricted to a set number of moves.

    drive.google.com/file/d/1N3yvrCkc3uxw74kD5VYxARlXavN7sUqE/view

  • If you can attach your project, I can take a look at it for you.

  • drive.google.com/file/d/1bFw9URYwNhyfiG_TbDdZSrYoPcnlwzZX/view

    Take a look at this example. There are 2 layouts. One that has very minimal actions. All you do is click the red ball to kill it but each time it is clicked, it becomes invulnerable for 5 seconds.

    The other uses an 8 direction controlled player that will trigger the ball to be invulnerable. It also causes the ball to flash when it is invulnerable.

  • GamerDude96, a Boolean variable as mentioned by Maverick1912 is a good way to handle this issue but requires you to code when to disable it. I prefer to use an integer variable that stores the time to end invulnerability. When the character becomes invulnerable, you would set:

    invulnerableUntilTime = time + X seconds

    Then, when damage would be dealt to the character, you would check if:

    time > invulnerableUntilTime

    With a Boolean, you still have to set the value and check it but this completely removes the need to set the Boolean value to false. By nature of the passage of time, the invulnerability will be remove.

  • the.sand, Don't think of it as an array. Think of it as a stack. You are adding and removing actions from the stack. Only the action on top of the stack is active. The others activate as the top action is removed and the next is uncovered.

    Also, if you do take a look at the example by calminthenight, you will notice without the stack, more events and variables are required just to get 2 directions to work. To get the other 2 directions, you would have to double both the variables and events. That makes the code more difficult to work with and debug when something goes wrong. It is a fine example if you don't want to make use of the stack but, you can see the event sheet can very quickly become hard to follow.

  • calminthenight The built in movement controls don't allow for overriding one direction when another is pressed in the way the OP describes. If you try it you will see, that up and down will override left and right but left and right won't override up and down. Also, opposing directions cancel each other out. The OP wants the most recent pressed directional key to move the character even if another key is still pressed.

  • I don't really understand the need for the individual Booleans you are defining. In every place you would use your Boolean, you can just reference if the key is down. The added Boolean value just bloats the system and makes it harder to read/debug.

    As for the question about keeping track of what is the last key pressed, you could implement a stack which stores key press information and check the last key on the stack when trying to move. See the attached example. The stack is built using an array and when an arrow key is pressed, the direction is added to the front of the stack. When the key is released, the direction is removed. Then, to determine the direction the player will move, the front item is checked.

    If you really do need the Boolean values, just replace the "is down" conditions with your Booleans.

    drive.google.com/file/d/1unE5jG0C7lq8iU_Lrji5ltvD616Wq9H-/view

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads