# Zoom & Be - my new game

**URL:** <https://forum.defold.com/t/zoom-be-my-new-game/64864>\
**Category:** Showcases\
**Created:** [April 14, 2020, 5:42pm UTC](https://forum.defold.com/t/zoom-be-my-new-game/64864 "2020-04-14T17:42:28Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lampogolovii](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lampogolovii/32/19403_2.png) [@Lampogolovii](https://forum.defold.com/u/Lampogolovii)\
**Post date:** [April 14, 2020, 5:42pm UTC](https://forum.defold.com/t/zoom-be-my-new-game/64864/1 "2020-04-14T17:42:29Z")

</div>

Hi guys, I’m Tim (Lampogolovii)

We’ve just released our game “Zoom & Be” on html5.

 ![600x200](https://forum-defold.b-cdn.net/uploads/default/original/3X/9/9/9985b5e30789f3fb2bbfd1112056364e29722203.jpeg)  
And I’d like to thank Defold-team and community! You all are breathtaking! (c, Keanu Reeves)  
You helped me a lot!!!

Here you can find my thoughts about the engine and our plans about the game.

**Our story**  
Previously we made several flash/unity3d games on different platforms. And now we decided to try html5. So, I’ve been looking for the engine, which can build to web (unity3d webgl isn’t allowed on portals nowadays). And, yeah – Defold has list with great html-5 games. So, we started to make a game with Defold.

**The game**  
“Zoom & Be” is a puzzle platform game. You control two players at the same time. [Play here](https://poki.com.br/g/zoom-be)

 ![level_1](https://forum-defold.b-cdn.net/uploads/default/original/3X/d/0/d088f4c343f59b2ca99f3cc2202694111bd4c9b4.png)  
Yes, there are enemies/zombies on some levels:

 ![zombie_1](https://forum-defold.b-cdn.net/uploads/default/original/3X/c/3/c35e6a9b5e71377e388f474686ba0c30368a0a5d.jpeg)

**Problems**  
Of course I had a lot of problems, while I was making the game.  
Such as:

- I can’t set the linear velocity to a physic body? How to make a proper jump in this case?
- What? I can’t create physic shape on the fly? How to make solid tiled based level? (with no corners on each tile)
- No RaycastAll methods, no runtime masks/groups changing e.t.c
- So, there is no a lot of things, that I previously used to do…  
And yes – most of these things can be done by different approaches and tricks. Yay! Most of the problems are solvable! Thank this forum and the community!

_There was a situation, like_  
_Me: is there any way to pause a sound and then continue from the paused position?_  
_Chat: hm… we’ll see… ok, done! Download the new Defold-engine – and now it is possible._  
_Me: whaa?! How does it work in your world? I shouldn’t wait till next year, when updated engine comes out?!_

**The future**  
Now we are working on the mobile version of the game.  
Fit to all screen sizes, ads integration, virtual buttons and all this stuff. I’d like to praise the speed of the game loading on mobile. I barely see the splash-screen on iOS-platform. True magic! I hope to release the game in a month.  
We have big plans on game updates. New levels, new graphics, new skills are coming.

 ![switch_1](https://forum-defold.b-cdn.net/uploads/default/original/3X/3/0/30617bdf8a4e7638b09b26930f7c22ae4f47c0d4.jpeg)  
**Nintendo Switch**  
Also, I’m wondering – is it possible to build the game to Nintendo Switch platform?  
We already have Nintendo Switch Dev Kit, and developer’s account.  
So now what we need – possibility to make a build and polish the game in that way.  
Is it in your roadmap or something?

**A little bit more problems and my mistakes, that I experienced:**

- I made my own gui based on sprites – and run into limitation of 16 input listeners
- You can’t use proxy sync-loading. Because of music interruptions and glitches while loading.
- Rendering only z: -1 to 1 values. Wow! That was a surprise!
- Limit on max count of sprites. Strange thing, that disabled sprites count too…
- Can’t change position of physic body in one frame. I have to disable – change position – wait a frame – enable again.
- Defold doesn’t have hotkeys editor. Can’t duplicate / delete lines, go to declaration and some other useful hotkeys.
- Html5 build is still bigger, than I expected. Working on that.
- After c# I used to type ; everywhere. I had a lot of problems with this in Defold/Lua.
- go.prorerty(“”, “”);  
And local build works fine. But when I try to build to any target platform – and yes, build failed. From the error’s text it can’t be realized, that the problem is in ; at the end of the line.

**Some of the Defold Great things:**

- Local build starts incredibly fast! Awesome work!
- Mobile build is really small as possible! So now I have plenty of space to put extra resources to the game and I don’t worry about the size.
- Time-scaled update. I implemented “pause”-button to the game in 5 minutes! Just one line with changing scale of time.
- Easy to start! Month or two – and I could make working code and build my own game.
- I really like the modular approach in Defold. I can cut off some libraries, that I don’t need. And I can add libraries, that I want (defos, analytics e.t.c)
- …and a lot more!

 ![end_2](https://forum-defold.b-cdn.net/uploads/default/original/3X/5/d/5d034fb6483071d16f1762761075f7f0e03ea8f4.jpeg)

---

<div class="post-metadata">

**Author:** ![sergey.lerg](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/sergey.lerg/32/3970_2.png) [@sergey.lerg](https://forum.defold.com/u/sergey.lerg)\
**Post date:** [April 14, 2020, 9:01pm UTC](https://forum.defold.com/t/zoom-be-my-new-game/64864/2 "2020-04-14T21:01:07Z")

</div>

Great! Please work with the Defold team to create a Nintendo Switch support, I think they all are very interested.  
For physics - you can use my Box2D extension, which removes most of the limitations of the built-in physics.  
Sprites and 16 input sources - you just have to have a single input manager and distribute all the inputs manually. I do it in my games with automatic z sorting so that clicks go to the top objects first.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [April 15, 2020, 7:43am UTC](https://forum.defold.com/t/zoom-be-my-new-game/64864/3 "2020-04-15T07:43:20Z")

</div>

Thank you so much for the amazing feedback and congratulation on a great new game!

> [@Lampogolovii](#):
>
> Also, I’m wondering – is it possible to build the game to Nintendo Switch platform?  
> We already have Nintendo Switch Dev Kit, and developer’s account.

Let’s talk! Send me an email: bjorn@defold.se

Edit: And please [Get your game listed on www.defold.com! - #5 by britzl](https://forum.defold.com/t/get-your-game-listed-on-www-defold-com/64369/5)

---

<div class="post-metadata">

**Author:** ![Lampogolovii](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lampogolovii/32/19403_2.png) [@Lampogolovii](https://forum.defold.com/u/Lampogolovii)\
**Post date:** [April 20, 2020, 1:07pm UTC](https://forum.defold.com/t/zoom-be-my-new-game/64864/4 "2020-04-20T13:07:55Z")

</div>

> [@sergey.lerg](#):
>
> For physics - you can use my Box2D extension, which removes most of the limitations of the built-in physics.

Wow! Great! Where I can find the extension? Now I’m facing one of the most silly Box2D limitations - 16 groups/masks max. Is it possible to avoid this limitation somehow?

> [@sergey.lerg](#):
>
> you just have to have a single input manager and distribute all the inputs manually

Yeah, I did something like that too… input manager, that sends messages to all listeners. I think such thing should be as a default extension 🙂

> [@britzl](#):
>
> And please [Get your game listed on www.defold.com!](https://forum.defold.com/t/get-your-game-listed-on-www-defold-com/64369/5)

Thank you for your advice! I will try to free up some time and submit the game. Thanks for your help!

---

<div class="post-metadata">

**Author:** ![sergey.lerg](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/sergey.lerg/32/3970_2.png) [@sergey.lerg](https://forum.defold.com/u/sergey.lerg)\
**Post date:** [April 20, 2020, 4:48pm UTC](https://forum.defold.com/t/zoom-be-my-new-game/64864/5 "2020-04-20T16:48:39Z")

</div>

You can find info on my Box2D extension in this thread - [Box2D extension - open source now](https://forum.defold.com/t/box2d-extension/63901)  
It’s available via support on my Patreon page.

---

<div class="post-metadata">

**Author:** ![sergey.lerg](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/sergey.lerg/32/3970_2.png) [@sergey.lerg](https://forum.defold.com/u/sergey.lerg)\
**Post date:** [April 20, 2020, 7:40pm UTC](https://forum.defold.com/t/zoom-be-my-new-game/64864/6 "2020-04-20T19:40:25Z")

</div>

> [@Lampogolovii](#):
>
> 16 groups/masks max. Is it possible to avoid this limitation somehow?

That’s Box2D limitation, the same in my extension. However you can assign any values to the physics object’s table, for instance you can have a .custom\_type field which would mark your collision groups and depending on these values you can disable happening collision events, resulting in objects not colliding.

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [June 21, 2020, 9:11am UTC](https://forum.defold.com/t/zoom-be-my-new-game/64864/7 "2020-06-21T09:11:20Z")

</div>

> [@Lampogolovii](#):
>
> No RaycastAll methods, no runtime masks/groups changing e.t.c

In [1.2.170 Beta](https://forum.defold.com/t/defold-1-2-170-beta/65484) we have a fix for that (if I understand your request right):

> [@Defold 1.2.170 BETA](https://forum.defold.com/t/defold-1-2-170-beta/65484/1):
>
> Another physics fix is that the `phyics.raycast()` have been updated so that it can return all the raycast hits. See the [documentation](https://defold.com/ref/alpha/physics/#physics.raycast:from-to-groups-options) for further info on how this api has changed (it is still backwards compatible though).

Could you please take a look?

---

<div class="post-metadata">

**Author:** ![Lampogolovii](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lampogolovii/32/19403_2.png) [@Lampogolovii](https://forum.defold.com/u/Lampogolovii)\
**Post date:** [July 8, 2020, 2:25pm UTC](https://forum.defold.com/t/zoom-be-my-new-game/64864/8 "2020-07-08T14:25:05Z")

</div>

> [@AGulev](#):
>
> Could you please take a look?

I’ve tested raycast with “all” flag.  
Yes! It works correctly! Thanks for this feature!  
Two minor things:

1. When I use physics.raycast(st, en, groups, { **all = false** }); it returns list with raycasts anyway.
2. As I tested, the list is sorted by fraction value all the time. (As I know Box2d does it in the same way by default algorithm). It should be documented, I think, because it’s very useful.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [July 8, 2020, 2:52pm UTC](https://forum.defold.com/t/zoom-be-my-new-game/64864/9 "2020-07-08T14:52:47Z")

</div>

1. Yes, if you pass a table, you’ll get the new return format, a list. (it’s mentioned in the documentation)
2. Good idea, we’ll add it.

---

<div class="post-metadata">

**Author:** ![Lampogolovii](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lampogolovii/32/19403_2.png) [@Lampogolovii](https://forum.defold.com/u/Lampogolovii)\
**Post date:** [July 8, 2020, 3:22pm UTC](https://forum.defold.com/t/zoom-be-my-new-game/64864/10 "2020-07-08T15:22:05Z")

</div>

> [@Mathias\_Westerdahl](#):
>
> Yes, if you pass a table, you’ll get the new return format, a list. (it’s mentioned in the documentation)

 ![34](https://forum-defold.b-cdn.net/uploads/default/original/3X/3/0/302f0a809f78a89b39ad9e87ac79e6b4805e3d54.png)  
It’s not obvious for me from this explanation. It would be better as something like  
“If options table isn’t nil, then result is a table too”.

Also: thank you!!! RaycastAll is very useful in many cases! You saved a lot of time for developers! Thanks!

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [July 8, 2020, 3:50pm UTC](https://forum.defold.com/t/zoom-be-my-new-game/64864/11 "2020-07-08T15:50:40Z")

</div>

I think the return value _is_ pretty well explained:

```lua
RETURNS
result [table] It returns a list. If missed it returns nil. See ray_cast_response for details on the returned values.

```

Only thing missing is the comment about it being sorted w/respect to hit time.

---

<div class="post-metadata">

**Author:** ![Lampogolovii](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lampogolovii/32/19403_2.png) [@Lampogolovii](https://forum.defold.com/u/Lampogolovii)\
**Post date:** [July 8, 2020, 4:06pm UTC](https://forum.defold.com/t/zoom-be-my-new-game/64864/12 "2020-07-08T16:06:20Z")

</div>

but… it returns ray\_cast\_response if options == nil.  
so:  
options == nil → ray\_cast\_response  
options ~= nil → list of ray\_cast\_response  
Am I right?

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [July 8, 2020, 4:26pm UTC](https://forum.defold.com/t/zoom-be-my-new-game/64864/13 "2020-07-08T16:26:12Z")

</div>

Your list is correct.  
This is due to backwards compatibility.

> [@Lampogolovii](#):
>
> it returns ray\_cast\_response if options == nil.

That part is now deprecated. And it’s no longer part of the documentation.

---

<div class="post-metadata">

**Author:** ![Lampogolovii](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lampogolovii/32/19403_2.png) [@Lampogolovii](https://forum.defold.com/u/Lampogolovii)\
**Post date:** [July 8, 2020, 4:40pm UTC](https://forum.defold.com/t/zoom-be-my-new-game/64864/14 "2020-07-08T16:40:22Z")

</div>

oh! I see! I understand now! Thanks!
