lionz's Recent Forum Activity

  • What logic are you using to pick up the objects? If you're using drag/drop behaviour then this shouldn't be a problem as it will pick one at a time, but maybe you're not using that. Anyway since you're having a problem with it, look into Pick top/bottom condition on the object, you can pick the top object each time so one at a time.

    Edit: I just realised that your problem is you want to pick up one 'type' of object at a time. You can still pick types by giving red/blue instance variables type=red and type=blue to distinguish between them. Then you would pick up all with type=red or whatever fits the game.

  • Disabling the controls will only disable the movement but it won't stop your animation events which are probably on key pressed - play animation. Add a condition to your play animation for WASD events, to play only if hp > 0.

  • Whatever the solid is that the bullet is colliding with, you can use the spawn action for that solid to spawn the platforms on the solid, or at an imagepoint/particular location on that solid. If it's 5px away then move an imagepoint 5px away and spawn them there.

  • Set default controls to No to limit all the movements. Then create an event on jump button pressed, platform simulate control jump.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For health bars you can put it in a container with the enemy. It gets rid of the create health bar logic, instead it will be automatically created although you will still need to set position, and when you destroy the enemy on hp 0, health bar will go with it automatically as well.

  • Good luck with the game development :)

  • Move the 'does not have line of sight' event out of the sub event of the 'has line of sight' event, it should be its own event. Line of sight and no line of sight cannot be true at the same time.

  • The actions you are running for on text changed event, add them to the set text event.

  • You do not have permission to view this post

  • Assuming playerprojectiles is the bullet hitting the enemy, the event should be Playerprojectiles on collision with enemy, so you can pick the projectile, then destroy it. That should also fix the hp problems as projectile on collision with enemy will pick that enemy and subtract damage.

    Although family logic can be used to reduce some code such as 'create healthbar for red' 'create healthbar for white' etc, you can still split out some code to define things for different types. To do this, create a family instance variable 'type' and then you can assign all stats to red type and all stats to white type on created. So if type=white it will have the appropriate health.

  • Nice game. I bought it, and Pinkman, to give you some support there.

  • Well one issue I can see is that you haven't made use of the family. The whole point of putting enemies in a family is that you don't have to duplicate code, which you have done. Your code should apply to all enemies so there is definitely some redundant code in there. The health bars at least should be in code like on Enemies created, spawn healthbar. Enemies set healthbar to enemies.hp.

    Anyway the actual bug, it's because your set position for the health bar is in its own event and it does the last one on the event sheet, so every tick it is setting the health bar to the position of enemy 2. The set position events for the health bar do not relate to anything and are independent events. The one above for enemy 1 is ignored, you won't see anything happen for that, and if you look in debug mode you will probably see several health bars in that enemy 2 location overlapping each other.

    As for resolving the issue, if you reduce the code as stated above to on Enemies created, spawn healthbar. You can then pin it to the Enemies position at that point and not every tick.

lionz's avatar

lionz

Member since 5 Aug, 2013

Twitter
lionz has 73 followers

Trophy Case

  • 11-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 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
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

24/44
How to earn trophies