lionz's Forum Posts

  • Object.PickedCount

  • The layout size is infinite, you can scroll forever, and it doesn't affect performance. You should only really be concerned about the number of objects, especially the objects that use large images and take up a bunch of memory. Objects that are off screen are not rendered and hardly affect performance. Just take into account the total memory usage for that layout and try and keep it under 100mb. I would say best practice though is to do what you're trying to avoid and mimic the scrolling, creating a large level isn't too useful although you can make use of the tilemap object that helps to keep memory usage down when drawing a level.

  • Pretty much impossible to assist without seeing what you've done with events.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Probably because the Y co-ord can be to many decimal places so it's struggling to get an exact match. Try using floor(sprite.y) to round to a whole number or use the good old less than or equal to sprite.Y.

  • I would do something like this : have health as a family instance var if not already. Give the health bar object you're using an instance var i.e. ID. On mob created, create health bar, set health bar. ID to mob.UID (now they are related). Then to display health you evaluate by saying where healthbar.ID = mob.UID set healthbar.health to mob.health.

  • klabundee

    sidetrack I know but ooo nice looking game

  • Using 'On created' to pick the ship you can then store UID somewhere, depends what you want to do with it.

  • My guess is that if the text worked then the animation change worked but you have code elsewhere that overrides the animation displayed. for example, you have if sprite.UID=1 set anim, but elsewhere you could have the sprite animation set to be idle if its a player that isn't moving or something similar. A possible issue is also a typo with the animation name.

  • Do you mean to get the data and use it in code or simply view it? In debug mode you can see the ID of the objects. Also think about putting the ship and antenna in a 'container' where you can create them as one object.

  • It's pretty obvious if you compare the two, look at the order of the events in actual compared to test. The test code is correct picking, every time you pick an enemy you set the name to the glob var then add 1 to glob var. In actual you are adding 1 to glob var for every enemy, so the total number of enemies, then setting the enemy name for all enemies to the glob var number. Be careful with the order of events and sub-events, you've done it correctly in test code though so I can see you know what you're doing.

  • You can do all of this with the Persist behaviour, it will remember what you picked up when you go between rooms : https://www.scirra.com/manual/161/persist

    In terms of your actual logic, you can't pick the sprite plugin, only the objecttype.UID so spritecoin.UID, spritediamond.UID. What you could do is put all collectable items into a Family and use Family.IID.

  • On enter pressed is one event.

    Compare XYZ is a new event that's correct but instead of picking System, you pick the Array object and the conditions are in there.

    If you still can't work it out I can make a file later on today.

  • On enter pressed ,

    Set a global variable i.e. name to textbox.text (the input)

    For each XYZ element,

    compare current value = name > something happens

    else

    something else happens

  • In each event yes both conditions have to be met, it looks like both the turns variables are always true but I can't see the rest of your logic. It's an easy fix, rework the logic like I mentioned in first response or feel free to send over C3 file so I can edit it.