• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows I do not know what to do (dress up game)

nnn1czech

Member
Nice day,
I do not speak English very well. Translated text online translator.
I was looking for, but I did not understand the answer or did not find. I tried different things. I read a few questions here on the forum. It did not help.

I have created object control. Code circumscribed from here:
https://forum.yoyogames.com/index.p...with-mouse-advanced-options.11852/#post-79635

I do not understand how to use the code: ds_list_find_index(list, inst.object_index)
I do not understand what the part in brackets "list". I have somewhere to include additional code that activates this? What? What to in write it?


I want the player to take the mouse only one object. Even if several objects to each other. I have several objects with one parent (obj_clothes1).

Please, what should I do?

Codes in obj_clothes1
In Create Event
selected = false;

xx = 0;
yy = 0;

In Event Steep:
if (selected == false)
{
exit;
}
else
{
x = mouse_x + xx;
y = mouse_y + yy;
}

In Event Mouse: Left Pressed:
selected = true;
depth = -1;

xx = x - mouse_x;
yy = y - mouse_y;

In Event Mouse: Left Released:
selected = false;
 

Tsa05

Member
list is a variable that refers to the list you wish to find a value from.

Use this to make a list:
list = ds_list_create();

To add items to the lost, use this:
ds_list_add(list, value)


I can't be very specific without knowing how you have created your game and the various dress-up objects, but you can add the object index of each "draggable" object to a list. For example:
var dress = instance_create(0, 0, obj_dress);
ds_list_add(list, dress.object_index);

Of course, you can put whatever values you wish to keep track of into the list--I put object_index in the example because that is the value that your sample code uses.
 

nnn1czech

Member
Thank you for answer. Maybe I did something wrong. It did not work. But I found that https://marketplace.yoyogames.com/ are some things for free download. So I found what I needed. Alas variable must be in each a scrolling object. (I downloaded Decorate the Christmas Tree - now it can be downloaded for free)
 
Top