# Write Phaser 3 scenes without \`this\`

**URL:** <https://phaser.discourse.group/t/write-phaser-3-scenes-without-this/6164>\
**Category:** Examples\
**Created:** [May 2, 2020, 4:39am UTC](https://phaser.discourse.group/t/write-phaser-3-scenes-without-this/6164 "2020-05-02T04:39:48Z")\
**Posts on this page:** 4\
**Page:** 1

<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:** [May 2, 2020, 4:39am UTC](https://phaser.discourse.group/t/write-phaser-3-scenes-without-this/6164/1 "2020-05-02T04:39:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dov](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/dov/32/1959_2.png) [@Dov](https://phaser.discourse.group/u/Dov)\
**Post date:** [May 5, 2020, 10:41am UTC](https://phaser.discourse.group/t/write-phaser-3-scenes-without-this/6164/2 "2020-05-05T10:41:05Z")

</div>

@samme thanks for sharing, and of course it works fine.  
but what problem are you trying to solve?

`this` is a very useful language construct.  
By changing it to a global, you lose core strengths of Phaser’s architecture:  
the independence of scene instances, and the facile inheritance of scene classes.

You can no longer, for example, craft a basic scene:for your game (`JumpScene`)  
and then extend the scene to create your levels. `StreetJumpScene`, `CaveJumpScene`, etc

I am surely missing something. Please explain.

---

<div class="post-metadata">

**Author:** ![UltimateProGrammer](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/ultimateprogrammer/32/3069_2.png) [@UltimateProGrammer](https://phaser.discourse.group/u/UltimateProGrammer)\
**Post date:** [May 5, 2020, 1:56pm UTC](https://phaser.discourse.group/t/write-phaser-3-scenes-without-this/6164/3 "2020-05-05T13:56:58Z")

</div>

I think the reason for posting it was that `this` is really confusing to learn as a beginner. When I started Phaser at least (I had only done javascript for 3 months as a hobby) I had no idea what `this` was referring to and I just assumed it was some magical keyword that made everything work. It took me at least a few weeks to finally google what it was 😁.

---

<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:** [May 5, 2020, 5:03pm UTC](https://phaser.discourse.group/t/write-phaser-3-scenes-without-this/6164/4 "2020-05-05T17:03:09Z")

</div>

@Dov indeed, I should have explained. I was trying to think of a technique for people who are stuck on the matter of [using `this` in scenes correctly](https://github.com/samme/phaser3-faq/wiki#how-do-i-use-this-in-a-scene) and who would rather access the scene like a “normal variable”.
