99Instances2Go's Recent Forum Activity

  • Well, to be honest, there is one thing that i did not correct. Yet every time i see it, it annoys me. Including in my own capx's.

    Setting the contents of a textbox each tick is no-no. It is really cpu time consuming. I am mostly to lazy to do something about it, because my laptop does not care that much. But if you take the same thing to mobile, it is really a no-no.

  • First you have to centre the layout. After that things are pretty easy.

    https://www.dropbox.com/s/e743o85fw15id ... .capx?dl=0

  • I made a few little adjustments with performance in mind.

    (not correcting errors, dont think there are errors, expect maybe the nearest not always picking, so it is up to you what you do with it)

    https://www.dropbox.com/s/k7cjp9shgu6dj ... .capx?dl=0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Instance variable 'ConfessColor'

    'mFrame' being max count of frames.

    Top event :Is on screen.

    (might need an action here ... set Sprite.ConfessColor to zero .. but i dont think it is needed)

    Sub event: System > For "i" = 0 to mFrame

    Same event : Sprite > Compare frame = frame = loopindex("i")

    action set instance variable Sprite.ConfessColor to Sprite.pickedcount

    Sub event under top parent : System > Pick highest .... Sprite.ConfessColor

    same event : system compare 2 values > Sprite.ConfessColor .. greater than ... 1

    action ... whatever you need, because if those actions run there are at least 2 sprites with the same frame. Understand that at this point only the sprites with Sprite.ConfessColor .. greater than ... 1 are picked. If you need to adress more sprites, you need a new top level event to start with.Preferable a function.

  • Of course, timers are personal. That is the point. Boolean's are personal too.

  • self-censorship

  • Set the animation temporally to the second animation. Store count in a local. Set it back.

  • 'mFrame' being max count of frames.

    Local variable 'OnScreen'

    Top level event : is on screen

    action ... set variable OnScreen to Sprite.pickedcount

    Sub event : Same event: System > For "i" = 0 to mFrame

    sub event : Sprite > Compare frame > frame = loopindex("i")

    In same event : System > compare 2 values .. 1st 'OnScreen' ... = .. 2nd Sprite.pickedcount

    action > stop loop

    action > whatever you like, because if this condition is true, they all have the same animation frame, set a local variable or so

    The other

    Local variable 'OnScreen'

    Top level event : is on screen

    action ... set variable OnScreen to Sprite.pickedcount

    sub event : sprite animation frame > 0

    sub event : system compare 2 values ... 1st OnScreen ... = .. 2nd Sprite.pickedcount

    action ... when this actions run, there is no sprite on screen with frame = zero

  • But, say you want to drop items from one place to another, while updating an array, and account for a user dropping items everywhere :

    https://drive.google.com/open?id=0B1SSu ... 1IxcXVodkk

  • Cant use containers, because killing the star would kill the disk.

    Give the star an instance variable 'parent'.

    When you create the disk and the star ... set star.parent to disk.UID

    Give the star an instance boolean 'selected'

    Now

    In the event where you pick the disk that is overlapping the ball and refine that to the top most disk ...

    Add a 'every tick'

    with the action ... star > set boolean 'selected' to false

    add the following condition ..

    star > pick by UID .. UID = disk.UID

    and the action ... star > set booelan 'selected' to true

    Now you can pick the right ball anywhere in your events with ...

    star is overlapping ball

    star has boolean 'selected' set

    Question ... why is this not working ?

    star is overlapping ball

    star is top most

  • In general.

    This is absolutely weird coding. Adding something to the array should be done once, and on the moment you add something to a cell. The same goes for removing. Now you add something to the array each tick. Because 'is overlapping condition' is true every tick that there is something on that cell. On the other hand 'is not overlapping' is true every tick that there is not something above the cell.

    This kind of stuff, checking overlaps every tick, will slowwww dowwnnnnn your game to the extreme.

    There should be no new code block for each cell. This is easily done with 1 code block for all cells, because they are instances comparing to 1 family.

    Specific.

    Event 4.

    Items is overlapping casilla. This is a pick condition. A pick condition makes a list of all instances/objects that meet the condition. Lets call this list the picklist. Now, 'Items is overlapping casilla' picks all items, every single member of the family items that overlaps with any casilla. At this moment the picklist contains all items and all casilla.

    'celda = 1" keeps from that picklist those cassila with celda = 1. Now the picklist contains ALL items and ONE casilla. The actions will run on this picklist.

    So if you use items.tipo in an action, which items will it use ? You did not specify an items. You feed all items to that action and expect C2 to gamble wich items it should use for items.tipo.

    Sorry if i sound harsh. I already apologise.

    But you should follow a few more tutorials about using 'instances' and 'familys'.

99Instances2Go's avatar

99Instances2Go

Member since 12 Feb, 2016

Twitter
99Instances2Go has 2 followers

Trophy Case

  • 10-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies