How do i make something like Inkball? (draw on the screen)

Hello there, im doing a game jam for a local competition and i have to use gdevelop for it. My idea currently is to recreate Inkball from the old windows game library, I have made the ball bounce but the only thing stopping me is to draw on the screen and make the ball collide to the line.

I would want to add more content but I have to put the basic mechanics (ball boucning, collisions between assets, line drawing).

I have tried something like Shape Painter but it didnt have the results that I wanted but i could improve from it. I am still a newbie so please be patient with me. Thank you and have a great day.

Hi and welcome here :slight_smile:
You can spawn a small object when cursor is pressed, and that should create the effect you’re looking for.

1 Like

Could you help me with an example? I still need to have the ball to collide with the “draw line”

Well, if you want more realistic physics with rolls, bounces and such, use the Physics behavior on both the ball (dynamic with round mask) and the dots (static).
Check this example:

1 Like

Have a look at the “Marching Squares Platforms Painter” example that comes with GDevelop. It allows you to paint the terrain. You’ll need to play round with the line thickness to get it more like InkBall :

1 Like

Interesting, i never know this works. im going to try to study the code and get back to you very soon.
Also I noticed that you helped a lot of newbies in this forum, I thank you for your work!

Good news! I have made the drawing stuffs, now i have several problems of it.

  1. the mouse is offcenter of the circle cursor
  2. there is no collision between the unmasked layer
  3. ive made some smaller brushes, but right now it just have this kind of effect (pic under the ball)

any ideas how to fix? I Just need to make the collision and mouse off center, thanks very much!

  1. In the shape painter object’s properties, uncheck “Draw the shape relative to the object position on the scene”.
  2. What do you mean, unmask layer?
  3. Look at the marching squares example and figure out how yours differs.
  1. Weird, I unticked both of them and I have this weird solitiare effect and it still doesnt work for me, I did ticked and unticked each of them but no fix.

  2. Sorry, i mean by the line when you draw them. I dont know to configure the collision so that the ball can bounce off it.

Hopefully we both can find a fix to my solution so that I can learn and create my own, thanks a lot!

Have a closer look at the marching squares example and see how it’s different to your game :

  • how is the line being drawn?
  • check the behaviours added to all the objects ( MarchingSquaresBhaviour & Platform to the shapePainter and PlatformerObject to the player object)

Good news! Everything is working perfectly, its just me that I accidentally miss tons of behaviour configurations. The “bgfordrawinglayer” is quite annoying but I forgot how to make it as background so that I dont have to resize it everytime I am doing the level designs.

Plus, I think I have to ditch the “bounce” behaviour to the ball that is the main player and I should put something like physics2.0 (i havent tried it out yet) so that I can configure the collision between the drawing part with the ball so it bounces off.

1 Like

Or even better, I could ditch the whole ball idea and have it something just like the MarchingSquares example but with more level designs. It would be much easier for me since I dont have to calculate angles, force, velocity and such.

What do you mean with this? You could look at making it an External layout, and adding it at the start of every scene.

Actually you know what, I already fixed it by placing the background on another layer.

There is another big problem, since I want to make different levels and designs, I have to update the marchingsquares behaviour but the problem is that I dont know. When I draw, it will always be stuck to the black border that is normally placed when you start a level in gdevelop. Perhaps I would try the “area bounds” in the event script and HOPEFULLY it lets me to draw anywhere I want.

Or i can avoid this by making each individual levels and copy paste those codes everytime I do a new level, i found that idea to be annoying.

If you want to avoid for us to chat longer like this due to spam, we can DM together like discord or somewhere. Thanks a lot bro

External events are the solution to that. Create a new external event , copy all the events that are common to all the scenes into that external event. Then remove all those events you copied from the scene, and link the external event in every scene you want it.

Think of Links to External Events as placeholders for the events. They tell GDevelop to execute the events in the external event as if they were in the scene events. The bonus of them is that there is only one place you make changes.

And better still, make each level an external Layout (for ease of loading, name them level1, level2…). You’ll only need one playing scene that loads the external layout for the level you want.

image

image

or

image


Here in the forums is fine - the problems you encounter won’t be unique, and it leaves a record for others to learn from.

1 Like

Will do, I totally forget about that :sweat_smile:
im going to tamper with a lot of stuffs now, thanks for your advice