resdesign's Forum Posts

  • I am using drag n drop on 6 items. Every time they are dropped in the correct place I add 1 to the global variable score.

    I have a text set to score for a visual feedback and it is working fine. The score reaches 6.

    When score = 6 I need a screen to slide in. However, though I think I have the correct code the slide does not move in.

    Set up: 6 labels - 6 boxes - six check marks - 6 red crosses. (feedback items show when element dropped).

    Code:

    system/compare variable score

    if score = 6 then move slide in (using LiteTeen) (LiteTeen is set to start from beginning)

    This does not work so I added another global variable finished = 0

    then I have if score = 6 then set finished to 1

    if score = 6 and finished = 1 then move slide in - set animation to frame 0 (good! image)

    if score < 6 and finished = 0 then move silde in - set animation to frame 1 (not so good! image)

    Does not work either.

    I tried to put the score variable on an every tick even too. still not joy!

    Any idea why this is not working?

  • i have the same instances for all the icons from 0 to 9 set in the UI. I gave them the same name inst_ID

    so I have:

    • obj_icon inst_ID 0 to 9
    • obj_icon2 inst_ID 0 to 9
    • obj_check inst_ID 0 to 9

    It seems like since I check these against the same variable, they should be the same. I could PM you a link to my file is your are willing to look at it. I am a beginner and things mystify me a little coming from javascript.

  • I have 10 icons with inst variable. obj_icon with click event

    I have 10 other icons with the same inst variable. obj_icon2 with draggable

    I have 10 other icons with the same inst variable. checkmark to show result.

    I have a text to show the value of checkIconNum to make sure it is correct.

    On the click event, I have a global variable that is set the the obj_icon instance variable and then this icon is destroyed to eliminate the click event.

    On the drop event of the second icon, I have this code.

    My problem is that there is no consistency. the 2 first chosen icons work as expected and then the following ones sometime work correctly, sometimes the wrong icon is detroyed.

    Could anyone tell me what I am doing wrong?

  • OK. I put the icon on 2 rows to see what happens. for solution 2, I also use pick for the obj_icon since I need to destroy that one too.

    But the result is not consistent.

    Here is an example:

    picked inst 3 - works

    picked inst 8 - works

    picked inst 0 - works

    picked inst 5 - check mark correct but obj_icon instance 9 is destroyed instead of 5 while the text shows 5 correctly.

    picked inst 1 - check mark correct but obj_icon instance 2 is destroyed instead of 1 while the text shows 1 correctly.

    picked inst 4 - check mark correct but obj_icon instance 8 is destroyed instead of 4 while the text shows 4 correctly.

    so this is really bizarre!

    Any suggestion why the result is weird?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Actually I am not sure why only part work but not all. As you can see in code below I tried 2 things:

    Solution 1: variable checkIconNum is set when clicking on the icon.

    Then in the drop event I pick the obj_icon and set it to ID_CHECK

    This works but since the obj_icon that has the click event is still there, then you still can click there to bring the question in

    Solution 2: I use the checkmark icon (obj_check) and set its inst_ID to checkIconNum

    I destroy obj_icon so the click event is destroyed too

    I set the opacity of obj_check to 100

    Solution 2 does not always work for some reason.

    Any idea why? Is the wait even not enough for the system to know what is going on?

  • OK! I actually changed thing a little. I added an animation to the obj_icon. I added a variable that is set on the click event to be equal to the obj_icon_ID. then I used:

    system Pick obj_icon instance checkIconNum and then set this icon to the animation.

    Thank you for directing me to "pick"!

  • I have a simple game in which I need to access the instance variable of some icons in order to have only a specific icon show.

    Here is the set up.

    I would be so happy if someone could help.

    I have 10 icons that are used for click events. This is an animation for which I have 10 frames and each copy is set at a different frame and has a different instance ID from 0 to 9 just like the frame numbers. These are called obj_icon

    I have 10 icons (obj_icon2) that are under these with same instance ID. these are used for drag and drop.

    Then I have another icon which is a check mark. These have also the same instance ID. Their opacity is 0.

    When I drop each icon, there are some feedback on the map. The original icon is detroyed and then the ckeck mark should change opacity. However, I am not sure how to do this because right now it changes all the checkmarks instead of only the one with the same ID as the obj_icon.

  • Update:

    It is working now. My take.

    As suggested by Chris Dmm on FB:

    Separate the layout for the intro screen from the game layout

    Add the screens on the layer and make it global.

    Voila.

    Not sure why it does not work when the screen are on the same layout though because the code is exactly the same.

  • OK. I made a sample with just my start screens and it is working. So there must be something in the game that is interfering. So I am working on it changing some settings to see if the problem is corrected.

  • Thanks Aphrodite. I am trying something right now and if it does not work I will try and make a sample to reproduce the problem.

    BTW I did not consider this being a bug but rather a mistake I am making somewhere. Thus I did not submit a bug.

  • Will this mess up the event on a PC?

    Basically I am not making a game for mobiles specifically, I am making games that are part of a webpage. Since people surf the web on they iPads and other devices, I want them to work on PC and mobiles as web page elements.

    I am very surprised that a click event would not work on an iPad since in HTML5 they do and I publish as HTML5.

  • I use click events on an intro screen and a help screen at the beginning of a game. The click event triggers a liteTween event that moves out intro and moves help in and then help is moved out on another click even.

    All works wonderful on the web but when the web page is seen on a mobile device, the click event do not respond.

    I added touch events and select use mouse input Yes. still no joy.

    Any one could tell me what I am doing wrong?

  • OK. there are 2 moveTo plugins - one is called moveTo and the other one is call Platform MoveTo. it is still not clear which one he is using in the tutorial but the second one does have the on Hit Target Position because the other things that are used belong to the first one. So this is very confusing.

  • I have the latest. Do you have the option "on hit target position"?

  • I have a question on your moveTo plugin.

    I am following a tutorial and the plugin's properties are different. Do I have a different version or did I do something that makes this option not available?

    He is selecting On hit target position and I cannot find it on mine. (click below to see the screenshots).

    His screen:

    My screen: