# How to make a custom event

**URL:** <https://discourse.processing.org/t/how-to-make-a-custom-event/3161>\
**Category:** Coding Questions\
**Created:** [August 31, 2018, 11:08pm UTC](https://discourse.processing.org/t/how-to-make-a-custom-event/3161 "2018-08-31T23:08:09Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [August 31, 2018, 11:18pm UTC](https://discourse.processing.org/t/how-to-make-a-custom-event/3161/2 "2018-08-31T23:18:51Z")

</div>

There is a bit of a challenge to implement your class. To draw on the sketch from your class, you need to pass a reference to your parent sketch right into your class. This can be explained a bit better after you show your code of how you integrate this code with `setup()` and `draw()` in your code.

For the time being, check this next post about states: [Need Help for Game Over / Timer](https://discourse.processing.org/t/need-help-for-game-over-timer/246)  
With states, you can change the page that is displayed. In the first state, you show the intro page, next state you show the menu page, next stage is the game and another state could be game pause or game over.

Kf

---

_[View the full topic](https://discourse.processing.org/t/how-to-make-a-custom-event/3161)._
