vtrix's Recent Forum Activity

  • yes but because of the onclick event, you pick one fruittype, so you need to reset this in a subevent and repick with the fruitvariable

    you could save the picked fruitvariable in the onclick event , so you know wich fruit you just clicked from the family and then

    in the subevent family fruittype= "clickedTypevar" // a variable where you save the fruitType you just clicked

    so now it works for all types

  • xanxion

    you should just give the fruits family a variable fruittype = "lemon" or "otherfruit"

    on click family fruits // this picks one fruittype

    compare familyvar fruittype

    fruittype = "lemon"

    subevent : system: pick all fruits(family) // this resets the "onclick" picking to all fruittypes

    family fruittype = lemon (this will pick all fruittypes of lemon)

  • PABERB

    if youre dealing with lots of data

    csv plugin

    or csv to array

    or json plugin (in progress but very useable)

    or combination of these

    the savedata can be alot smaller than the data you need to run your game, so i think webstorage should be ok

    edit: to load the data you would just place the data (csv or json) in the files directory and use ajax to load the data, on data loaded you get the string in ajax.lastdata, and with this you can continue, .. dont know if the plugin deals with the loading.

    you do have to be somewhat comfortable with c2, to use all of this, and large data games in general...

  • rosareven , yes i have the same problem on my nexus7, i can generally only browse the site, and reaction time is pretty slow , posting something is just not possible, it takes 2 seconds per character

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yann

    nice example, i think i just need to clear the current objects,

    will the clear function work like if you have object size 5, you clear this object, it will object size 0?

  • Yann , ah ok i thought you keep the length for array and size for object, yes please if you could first deprecate it for a while, that would be great

    well the importing from array to json is working, and its also one way to create/modify keys , it was pretty complicated if you consider that the array can be larger ( if items are added) than the json, i had to check where the existing objects ended, and make sure, that new paths to objects existed, maybe i just was better of deleting all objects and remake them, o well... it is noticeable faster tho... i joke

    about id, its because i have worked alot with arrays recently, that it made sense to me to put my objects in indexes, put in fact, working with id's it doesn't make sense to have it in an array, (the reason i want to use id's is because ordering could potentially be changed by moving indexes, + i can simply reference the objects in multiple places,

    so a better workflow would be to have objects with id's (like youre saying), and then i can simply put those id's an ordered list if i need it

    making this all work will be another story ..

  • about the key adjust , maybe thats where json.stringify is used or parsing, not sure, would having a template object on first run be any good or will you still have the naming issue

    ----

    oh great isEmpty and clear would indeed be usefull! , and yes size or objectsize, would make a better distinction

    i also tested/used json.family and this works as expected, picking the json by uid and then working with it..

    parsing the data of an object to an array went pretty smooth, just needed some vars to count the objects and properties, then push x for objects and y for keys and values, i also did the keys, to make sure i get the values where i want, still working on the array to json,

    something i want to try later is querying by ID's, (within the json structure), still wondering how its best/could be done, by looping properties, or direct access, problem is that its not like an array, to get to the id, you must first get the right object, ... (thinking), i can name the object as the id,.. but not if its in an array.. damn,.. maybe later it comes to me..

  • well the slicing goes very fast, but i guess, there's only one place the mesh gets splitted, but because of the 3d and the physics you get much variation, and it basicly generates two objects that gets bounced apart

    maybe its possible to come close to it, by generating different pieces and different motion (rotations) when slicing, and just call it a different style

  • i think custom movement has something that called push out of solid, combining that with a boolean, isdragging,

    on player touch start , set boolean, isdragging to true,

    on touch end, set bool to false

    if player.isdragging, set position player to touch position

    then using the push out of solid should keep the object from staying in overlap (in theory)

  • Yann

    while i can work around this, i would be nice to check the length of an object / not array.length

    examplecode:

    var myObject = {'name':'Kasun', 'address':'columbo','age': '29'}

    var count = Object.keys(myObject).length

    console.log(count);

    about the brackets, to me it looks like rounded would fit better, it doesn't refer to an object or array

  • bscarl88

    well, slicing the object at the exact spot will be difficult i think,

    but one way would be, to have an animation of a fruit being split in two, now, to make it a bit more realistic, you could get the angle of the split, thru the touch motion, and set the animation of the split at that angle, so it looks like its getting split in that direction, also adding some particles maybe depending on the angle..

  • i see its already been handled i had this solution..

    https://dl.dropboxusercontent.com/u/61666915/pickingproblem_test.capx

    but i agree that its really a pain this issue, especially if you don't know of this, and how to work around it,

    having the javascript console open can really help,, it showed an error on the color function

    + with the browser plugin, you can quickly log returnvalue

    ps: i think the only problem was the "pick random family instance"

vtrix's avatar

vtrix

Member since 24 Jul, 2011

None one is following vtrix yet!

Connect with vtrix

Trophy Case

  • 13-Year Club
  • Entrepreneur Sold something in the asset store
  • Email Verified

Progress

15/44
How to earn trophies

Blogs