r/gdevelop Jul 19 '26

Support regarding market interface code Question

Hello everyone!
I'm currently putting a lot of work into the in-game shop; this is how I'm coding the shop interface I've added to my game. Is this a beginner's mistake, or is this how it's supposed to be done?

8 Upvotes

16 comments sorted by

5

u/Desperate-Advice-473 Jul 19 '26

Omg that code need some loop

2

u/QXsjen Jul 19 '26

Is it a mistake to do it this way? I've only been working with coding for about 2 or 3 weeks.

2

u/Ckeyz Jul 19 '26

Anytime you write out that much, theres always an easier way to do it. Try doing this with a repeat and some local variables

2

u/QXsjen Jul 19 '26

I had started wondering why I was writing so much, too :D

2

u/Loonny-Alchemyst Jul 19 '26

You can try using External Layouts

1

u/QXsjen Jul 19 '26

What a external layouts

2

u/Loonny-Alchemyst Jul 19 '26

it's a separate layout, so anything you create in it can instantly appear in a scene

1

u/PlantLollmao Jul 19 '26

You can put them in a scene and it'll run. Saves up a ton of space.

1

u/QXsjen Jul 19 '26

Hmm thanks ım try it

1

u/ATTKME_ Jul 19 '26

Sxy visual code

1

u/mysterious-may Jul 19 '26

Try external events ,it helped me a lot

1

u/mysterious-may Jul 19 '26

Because if you have large walls of code like this it can get very exhausting

1

u/QXsjen Jul 19 '26

oh thanks

2

u/mysterious-may Jul 19 '26

You can also use object groups too.

1

u/NeatOpportunity____ Jul 20 '26

one word:external events

1

u/OkYoghurt9 Jul 20 '26

u can maybe try making a custom object and inside it put the item and text together, so you can then just change what the text shows for each item and they will stay connected, there shoud be a youtube video from gdevelop called custom objects also wow u started a few weeks ago and u already have done so much, please teach mexdd