dop2000's Forum Posts

  • What do you mean? You can resize and rotate any object with actions or Tween/Sine behavior. There are also Rotate and Orbit behaviors for rotation.

  • Here is a demo with two methods, enable one event group at a time and see which one you prefer:

    dropbox.com/s/mecf2ytroqh8wh4/ShipFiring.c3p

  • What if the ship is flying sideways, should the bullet fly straight up at 500 px/s? Or should it fly up and drift to the left?

    My guess is that the second picture is correct?

    In this case an easy solution is to apply two Bullet behaviors. One with speed 500 in the direction of the gun. And another with the ship velocity in the direction where the ship is moving.

    You can get the values for the second behavior with these expressions:

    shipVelocity = distance(0, 0, Ship.Physics.VelocityX, Ship.Physics.VelocityY)

    shipMovingAngle = angle(0, 0, Ship.Physics.VelocityX, Ship.Physics.VelocityY)

    .

    Or instead of Bullet behaviors you can set bullet position with events.

    When the bullet is spawned, save these values in instance variables: a1=bullet angle, s1=bullet speed, a2=ship moving angle, s2=ship speed.

    Then on every tick do this:

    Bullet Move s1*dt at angle a1
    Bullet Move s2*dt at angle a2
    
  • Yeah, but if you open the file nftUser.json included in your project, there is no "raids" array. You need to either copy the correct data into the project file, or request it from the web server.

  • This is the easiest method:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In your function you are trying to get data from "raids" array in JSON. But your JSON data doesn't have an array with this name. There is "assets" array, maybe that's what you meant?

    You can use any online JSON formatting tool to check the structure of your JSON file.

  • I don't understand what you are trying to do.

    There is a native Construct expression which you can use, you don't need JS. For example:

    TextInput set text to replace(Self.text, "A", "B")

  • First of all, you need to move event #2 to be a sub-event under #1.

    Remove quotation marks in the nftList variable.

    And check the structure of your JSON file - there is no "raids" array in it.

  • Try MoveTo behavior. On every tick Move to (Mouse.x, Mouse.y)

    If you configure deceleration, the object will slow down when close to the mouse cursor.

  • Yeah, form control objects don't like being scrolled. The best solution is not to use them. But if you must use textboxes and lists, you can try positioning them with events. Say, on every tick set TextBox Y to SpriteA.Y+offset, maybe this will work better than Pin behavior.

  • The difference in performance will likely be very very small. Don't worry about it.

    There is another way to organize your code - put events for each control type into separate groups. This way you can activate/deactivate each group, and events from deactivated groups will simply not run.

  • You do not have permission to view this post

  • It should work even if the image point doesn't exist.

    The formula for cursor is a bit wrong, it should be (playerHead.imagePointX("eye")+radius*cos(ang) , playerHead.imagePointY("eye")+radius*sin(ang))

    Although this still doesn't explain why the result is NaN. Maybe there are some other events which can change cursor position?

  • I have a very simple demo, check it out:

    howtoconstructdemos.com/a-system-of-doors-portals-to-travel-between-layouts

  • Tiles can also not be scaled, moved, rotated,

    Actually, tiles can be rotated (in 90-degrees intervals), flipped and mirrored.