usbtypec's Recent Forum Activity

  • This will work as long as Set Angle is enabled for the bullet. If it isn't, use Set Angle of Motion instead.

  • Personally I like to use the physics behavior. It sounds crazy, but it works.

    -Make the enemy physics hitbox a circle

    -Set the enemy physics iterations to something like 2 or 3

    -Set world gravity to 0

    -To move them toward the player, use Set Velocity -> cos(angle(Enemy.X,Enemy.y,player.X,player.Y))*Self.speed for X and sin(angle(Self.X,Self.y,player.X,player.Y))*Self.speed for Y

    Hope this helps!

    EDIT: I am now just seeing you already tried Physics and it was laggy, sorry about that. Although you could try to reduce the physics iterations of enemies, this will make them update less and increase performance.

  • As for the health bar, create a Sprite and call it whatever you want (I'll be referencing it as HealthBar)

    (This method I am using will make a health bar that will shrink as the enemy loses health. There are ways to make it look better but this is the easiest)

    Make sure the origin point of HealthBar in the center.

    Add an instance variable to Enemy and HealthBar called "id". Add a global variable called idTracker.

    Make sure the enemies have an instance variable called "hp" and "maxHP". When an enemy spawns, set its hp and maxHP to whatever health it spawns with. When the enemy takes damage reduce hp but not maxHP.

    Then for events:

    Enemy -> On Created : System -> Spawn Object -> HealthBar (Position: Enemy.X, Enemy.Y-50), then another action -> Enemy -> Set instance variable "id" to idTracker. Then another action -> Add +1 to idTracker (This makes sure every enemy has a unique ID). Then another action -> HealthBar -> Pin to Object -> Enemy. Then another action -> HealthBar -> Set "id" to Enemy.id

    Then on a new event:

    If HealthBar.id = Enemy.id (this should work iirc) : HealthBar -> Set Width -> (Enemy.hp / Enemy.maxHP) * 100 (or replace 100 with whatever width the HealthBar is when full)

    ____________________

    Sorry if this is long or confusing. If you want me to recreate what I just typed above and send you the file, let me know.

    Edit: Fixed a typo

  • What do you mean by individualizing? The "if Enemy.X > Player.X" already check the X of every individual instance of X. There isn't any need to make a unique variable for every enemy. Here's the manual entry on Object Instances. (I think there was a manual entry on intance selecting but I couldn't find it)

  • I've been messing around with your file, and I'm somehow stumped. Something this simple shouldn't be hard.

    If I find a solution, I'll tell you, but for now I've got no idea.

  • Pin is a behavior you can put on an object that will "pin" it to something else, so you can keep it at the same relative location.

    Here is the official manual entry for Pin

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For the enemies, here is a very simple AI:

    If Enemy.X > Player.X : Enemy -> Simulate Control -> Left

    If Enemy.X < Player.X : Enemy -> Simulate Control -> Right

    Note that this doesn't include jumping, which if you need I can help with that, just let me know.

    _________

    For the Healthbars, try:

    Enemy -> On created : Create Object -> Healthbar. Make sure that the position is Enemy.X, Enemy.Y-50 (Or change 50 to whatever is needed to position it properly), then Healthbar -> Pin to Object -> Enemy (Make sure those two actions are in the same event)

    If you need any more help or want me to create a mock-up and share it with you then let me know.

  • I haven't checked your c3p file yet, but my guess is the order of events is the problem. If I understand correctly, you want to player to pick Object2 (and use 50 opacity) if it is overlapping both.

    Event sheets run from top to bottom, meaning that the easiest way to solve your problem is to do this:

    Player is overlapping Object1 > Set Player Opacity to 10

    Player is overlapping Object2 > Set Player Opacity to 50

    Since Object2 is on the bottom, that means that if it is also run the same time as Object1, it will run last, meaning it would end with 50 opacity.

    Or do you mean second option as in whatever the player collides with second?

  • Currently there is no way to search for specific games in the Arcade, sorry about that. (although I really think they should add it)

  • I have no idea how to save online, but locally you can use LocalStorage.

    Add a function called SaveData (or whatever you want). In the function, add an action from the LocalStorage plugin to Set "____" to Value. Repeat that for anything you want to save (note that you cannot save booleans I think). Call SaveData whenever you want to save. Personally I like at the end of every layout and whenever something such as a purchase occurs.

    Then add another function, LoadData, then for every thing you saved, add LocalStorage -> Check Item Exists as an action.

    Then outside of the functions, add LocalStorage -> On Item Exists -> Get Item

    Then On Item Get -> Set _____ (whatever variable, array, etc you want to load) to LocalStorage.ItemValue

    Hope this helps!

  • Yes, C3 can export as a mobile app. Just note that Google Play requires a $25 USD signup fee for the developer account and Apple charges an annual fee of $99 USD, so remember that if you are planning for a phone app.

  • The image of the tilemap doesn't show up when you create the object, you have to use the Tilemap Tab (should be by the layers tab by default) and paint out the tiles. It'll be easier to understand if you go to construct.net/en/make-games/manuals/construct-3/plugin-reference/tilemap

    And it will always auto-size to be the layout size, but you can just resize it manually, so I don't see the big deal.

usbtypec's avatar

usbtypec

Member since 25 Sep, 2022

Twitter
usbtypec has 2 followers

Trophy Case

  • 2-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

8/44
How to earn trophies