winkr7's Recent Forum Activity

  • To achieve the effect where the player object remains stationary and the background rotates, you can implement the following steps in Construct 3:

    1. **Keep the Player Object Centered:**

    - As you've mentioned, use the "Scroll To" behavior on the player object to keep it centered on the screen.

    2. **Rotate the Background:**

    - Instead of rotating the player object, rotate the background layer or the enemy sprites. You can achieve this by manipulating the angle of the layer containing the background or the enemies.

    Here's a detailed step-by-step approach:

    ### Step 1: Add Scroll To Behavior to Player

    1. **Select the Player Object:**

    - Click on your player object.

    2. **Add Behavior:**

    - In the properties panel, click on "Behaviors" and then "Add New Behavior."

    - Select the "Scroll To" behavior to keep the player centered on the screen.

    ### Step 2: Rotate the Background or Enemy Layer

    1. **Create a Background Layer:**

    - If you haven't already, create a new layer for your background.

    - In the "Layers" panel, click on "Add Layer" and name it "Background."

    2. **Rotate the Background Layer:**

    - To rotate the background layer based on player input, you need to update the layer's angle in response to the WASD keys.

    ### Step 3: Add Event to Rotate Background Layer

    1. **Open the Event Sheet:**

    - Go to the event sheet where you handle player input.

    2. **Add Keyboard Events:**

    - Add events to handle the WASD keys.

    - For each key, update the angle of the background layer.

    Here's an example of how you might set this up:

    ```plaintext

    Event: Keyboard -> On W key pressed

    Action: System -> Rotate layer "Background" by -1 degrees

    Event: Keyboard -> On S key pressed

    Action: System -> Rotate layer "Background" by 1 degree

    Event: Keyboard -> On A key pressed

    Action: System -> Rotate layer "Background" by -1 degrees

    Event: Keyboard -> On D key pressed

    Action: System -> Rotate layer "Background" by 1 degree

    ```

    ### Step 4: Fine-Tune the Rotation

    You may want to adjust the rotation amount or implement smooth rotation using variables for a better effect.

    Example of smooth rotation using a variable:

    1. **Create a Variable for Rotation:**

    - Create a global variable, e.g., `Global number RotationSpeed = 0`.

    2. **Update the Variable on Key Press:**

    - Instead of directly rotating the layer, update the `RotationSpeed` variable based on key presses.

    ```plaintext

    Event: Keyboard -> On W key pressed

    Action: System -> Set value RotationSpeed to -1

    Event: Keyboard -> On S key pressed

    Action: System -> Set value RotationSpeed to 1

    Event: Keyboard -> On A key pressed

    Action: System -> Set value RotationSpeed to -1

    Event: Keyboard -> On D key pressed

    Action: System -> Set value RotationSpeed to 1

    ```

    3. **Apply the Rotation in Every Tick:**

    - Use the `RotationSpeed` variable to rotate the background layer smoothly.

    ```plaintext

    Event: System -> Every tick

    Action: System -> Rotate layer "Background" by RotationSpeed degrees

    ```

    4. **Reset RotationSpeed when No Key is Pressed:**

    - Reset `RotationSpeed` to 0 when no movement key is pressed.

    ```plaintext

    Event: Keyboard -> On key released

    Action: System -> Set value RotationSpeed to 0

    ```

    By following these steps, you can create a game where the player object remains stationary while the background rotates based on player input, giving the desired effect.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is what chatgpt40 says:

    In Construct 3, you can determine the x-coordinate position of a sprite using the sprite's `X` property. Here are the steps to find the x-coordinate position of a sprite:

    1. **Access the Event Sheet:**

    - Open your project in Construct 3.

    - Navigate to the Event Sheet where you want to determine the sprite's x-coordinate.

    2. **Add an Event:**

    - Add a new event by clicking on "Add event."

    - Select the condition that will trigger when you want to check the x-coordinate. This could be something like "On start of layout," "On collision with another object," or any other event that fits your needs.

    3. **Add an Action:**

    - Within the event, add an action by clicking on "Add action."

    - Select the object (sprite) for which you want to get the x-coordinate.

    4. **Get the X Property:**

    - To retrieve the x-coordinate, use the expression `Sprite.X` where "Sprite" is the name of your sprite object.

    - You can use this expression to store the value in a variable, display it on the screen, or use it in any other way you need.

    Here's an example:

    ### Example: Displaying X-Coordinate on Screen

    1. **Event:** On start of layout

    2. **Action:** Text -> Set text

    - Text object: Choose the text object where you want to display the x-coordinate.

    - Text: `Sprite.X`

    ```plaintext

    Set Text to Sprite.X

    ```

    ### Example: Storing X-Coordinate in a Variable

    1. **Event:** On start of layout

    2. **Action:** System -> Set value

    - Variable: Choose or create a variable to store the x-coordinate.

    - Value: `Sprite.X`

    ```plaintext

    Set Variable 'SpriteX' to Sprite.X

    ```

    ### Example: Using X-Coordinate in a Condition

    If you want to use the x-coordinate in a condition, you can directly reference `Sprite.X` in the condition.

    1. **Event:** System -> Compare two values

    - First value: `Sprite.X`

    - Comparison: `<, >, =` etc.

    - Second value: Any value or another variable

    ```plaintext

    Compare Sprite.X < 100

    ```

    By following these steps, you can easily determine and use the x-coordinate position of a sprite in Construct 3.

    So just to understand this, if we uses a 3rd party ad-on like Chadori's and they decide not to update it to SDK v2, our projects will break?

    You can always use an older version of c3 to build whatever worked before. All the older versions are out there (take a look and see).

    I am sure I am not alone when I say I would really like to see Ashly post everything he has said about this on this thread over again, and then copy that and post it again and sign it in blood.

    yours

    winkr7

    There are simple behaviors that you can do easily in the event sheet, like moveTo or Orbit but which make things easier and clear for the no-coding user.

    Behaviors like these with their own Icons make event coding much easier for the beginner. The value of developers for the wider base of non-publishing users is increased by this kind of simple to use, (but perhaps difficult to code) would be nice. Like some kind of float behavior for side-view stuff in water (hint hint).

    yours

    winr7

    As some of you pointed out, a competent developer puts a freeze on all versions of everything in the last mile before going live. That means stopping at SDK 1 or sooner and the state of plugins at that point. Its very easy to use any version of C3.

    When you do a 2.0 of your game you move everything forward. This is standard practice and no biggie--you have plenty of warning here about when you will have to redo your work. Same thing happens in Godot, in UEFN, Bloomberg, Microsoft, etc. etc.

    Yes, they did redo Rex Rainbows main contribution -- moveTo -- or whatever he called it.

    I know some of you are upset, but only 1 in 50 of us ever publish anything we do in construct. The other 49 would not even know what this thread was about.

    yours

    winkr7

  • You are pathfinding at the start of the layout--before you spawned anything to look for a path?

    Perhaps that is the trouble.

    yours

    winkr7

  • Make sure enemyTarget exists and is located somewhere you can find a path to it.

    yours

    wink7

  • Perhaps someone else can look at your code. I just post suggestions.

    yours

    winkr7

  • Create a small physics object at the point where the mouse is clicked and attach it as rotate joint to the object you want to drag. Every tick create an impulse from this created object toward the mouse if the distance is greater than 2 pixels. Have the impulse increase linearly with the distance beyond 2 pixels with a great deal of damping. Be sure to scale the impulse with dt so it works at any tic rate.

    yours

    winkr7

  • Things to try:

    Try saving the earlier version that does work as a project folder instead of single file. Take out any 3rd party addons.

    just suggestions.

    yours

    winkr7

  • I think if you turn off collisions for that solid you are inside it will ignore it. Don't forget to turn them back on again.

    yours

    winkr7

  • One slight addition:

    If you don't have an object (your count is zero) then you can create one with a create object event, then place that in the center.

    yours

    winkr7

winkr7's avatar

winkr7

Early Adopter

Member since 23 Oct, 2014

Twitter
winkr7 has 2 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies