Forums

OverviewV-Play 1 Support › Remove Entity when it leaves the Screen

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4484

    phil.jahoda

    Hi, I have a dartarrow entity, and what I want to do is remove it when it leaves the screen.

    Therefore, I thought of using the onYChanged method.

    How can I remove “the” entity in its own onYchanged method?

     

    EntityBase {
        id: entity
        entityType: "dartarrow"
    
        onYChanged: {
            // HOW TO REMOVE AN ENTITY HERE?
        }
    
        property bool showed: false
        property int number
        property real speed: 1000.0
    
         BoxCollider {
             // some more code here...
         }
    }
    
    

     

    #4486

    phil.jahoda

    Consider this problem solved.

    You can easily remove an entity by calling id.removeEntity(); within the entity.

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support