# Every 2 seconds, create sprite

**URL:** <https://phaser.discourse.group/t/every-2-seconds-create-sprite/6762>\
**Category:** Phaser 3\
**Created:** [June 23, 2020, 11:53pm UTC](https://phaser.discourse.group/t/every-2-seconds-create-sprite/6762 "2020-06-23T23:53:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![buqer\_ok](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/buqer_ok/32/3444_2.png) [@buqer\_ok](https://phaser.discourse.group/u/buqer_ok)\
**Post date:** [June 23, 2020, 11:53pm UTC](https://phaser.discourse.group/t/every-2-seconds-create-sprite/6762/1 "2020-06-23T23:53:55Z")

</div>

Every 2 seconds, create a sprite  
If this sprite collides with another, destroy the sprite  
And if this sprite is destroyed, it creates a new sprite

Somebody could help me?

---

<div class="post-metadata">

**Author:** ![buqer\_ok](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/buqer_ok/32/3444_2.png) [@buqer\_ok](https://phaser.discourse.group/u/buqer_ok)\
**Post date:** [June 24, 2020, 9:53pm UTC](https://phaser.discourse.group/t/every-2-seconds-create-sprite/6762/2 "2020-06-24T21:53:48Z")

</div>

For the first part, I came up with this but it doesn’t work.

```
function base() {
	this.physics.add.sprite(50, 50, 'base')
}

function createBase() {
	this.time.addEvent({
		callback: base,
		delay: 1000,
		callbackScope: this,
		loop: false,
	})
}
```

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [June 25, 2020, 7:43pm UTC](https://phaser.discourse.group/t/every-2-seconds-create-sprite/6762/3 "2020-06-25T19:43:48Z")

</div>

https://codepen.io/samme/embed/preview/JjGJxOg?height=300&slug-hash=JjGJxOg&default-tabs=js,result&host=https://codepen.io
