warville's Forum Posts

  • hey, i already found a solution to my problem , the idea is complex but the code is very minimised and short , you wont beleive how easy it was. the goal of my request was , i have many instance of the same sprite each one will be showing a different animation , whene i press i butoon i want them all to show a specifique other animation for each sprite ,

    thank you guys ^^

  • Add a browser plugin, you can get the project name from it

  • Closing as not a bug

    I'm sorry , i didn't know where to post this , but i already reposted it in the gneral section.

  • yes , it could be done with 200 event at lest since this way i must make a unique action for each sprite 100 for value tests and 100 for changing the animations . if i make it with events , this will become a project for itself it can't be included in nother project.

  • Problem Description

    my problem can have many solution, i'm not C2 js sdk developer or i would make the changes myself.

    i want to pick the sprite animation name using index and not only the current animation name. or let us at least set animation with index or let us name the animation frame with text and get the animation name in a given index.

    Expected Result

    get animation name at a given index.

  • This should be in the , with a [Feature Request] tag, so people can discuss your idea and the developers might pay it attention depending on feedback.

    oh okay thanks i didn't know where to publish this thread

  • in order to make buttons like this you need to make sprites , because the buttons only styles basic stuffs text color , background color , text size and border... just basic

  • I am so thankful, that that was so easy to do. I'm still new to the whole save game thing, so I didn't realize there was a behavior I could use. Either way, thank you so much!

    you are very welcome

    here is a tips can be helpful to you in future : always check for C2 updates , don't forget to read the releases notes

    or each time you install an update don't forget to chak the objects box you might finde a new object , and chek beahviors there might be new ones, this way you will know all features in C2 and by the way check the plugins and beahvior in the forum there is very helpful stuffs will make you do what you think you can't do

  • :? Heh. You've got me confused and overwhelmed here. I somewhat understand what you're doing here, but it seems so complicated. I'll think on it for a bit and see if anything comes to mind, but at the moment, I got nothing for ya.. Good luck!

    haha thanks man, i was afraid maybe i'm just not good enought to find a solution but it seems really defficult issue :i know there is a solution but i can't do it myself because it need some Js Sdk knowledge , like wrapping the sprite plugin and make it returns the animation name at a given index.

  • Problem Description

    my problem can have many solution, i'm not C2 js sdk developer or i would make the changes myself.

    i want to pick the sprite animation name using index and not only the current animation name. or let us at least set animation with index or let us name the animation frame with text and get the animation name in a given index.

    Expected Result

    get animation name at a given index.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • prevent the enemy from saving by addming a behavior No save to the enemies

  • Why do you need to get the animation name? If for some reason, you really need to do it that way, you could do something like if sprite animation frame = 1, then set a variable to whatever you want it to be called. if frame is 2, then change the variable to whatever you like. etc.. then you could call on that variable to do whatever it is you're doing. (this essentially does what you were asking for originally about giving the first frame a number like 95)

    But I really don't think it's necessary to do all that if I'm understanding correctly what you're doing.

    unfortunatly you didn't , let me tell you why i need it you might suggest me easy solution to my problem, i hade problem with Android keyboard when it shows it scales my page down and make it very small , but i some element are important i need them to still looks big , generally i don't want the page to scaldown. i couldn't figure out how to fix that . so i decided to make my own costum keyboard , i wanted to make buttons for the keyboard but you can't text from button unless you use values don't forget each button have many layers ( i mean lower case , uppercase and special character ) so picking up a value and changing the button text each time isn't a good idea , i thought to make the buttons as sprites, and make 3 different animations for it ( lower case , apper case and special character) i used animations not frame because it have text name while frames uses numbers , so each time you touch the sprite gives you the animation name , and i will name the animations like ( char_91 ) a special text followed by the ascii code of the character shown in the animation then i will remove (char_) , why i use ascii ? because you can't name the animaton with special characters unless you name the button's animation like ("doublecotes") then make text replace and replace that part with doublecotes and that would be a pain to make a special action for each button .

  • i hade same performance problems as you in the begining ,here are some performance tips :

    • manually make your collision polygons and reduce the points if possible.
    • don't make very big objects , i know when you are a begginer you just drop 2000x1000 image to be a backdround

    just split it for example the background for the sky used a tiled background using small 32x32 single color image.

    and the backgrounds element as sprites for examples the trees and clouds and moutains each one of them in a sprite , that would be usefull to make parallax too to make the game looks nice.

    • reduce the loops and timed events as much as you can , when you know the score will change only when action happens for example player passes an obstacle , there is no need to make everytick set text....that uses a lot of the devices resources with no need.
    • if you need an object with 64*64 size don't make 256*256 then scale it down in the editor thats not helpful to save the platform resources.
    • try not to make more than 20 sprites in a single layout. if you need something to be used in another layout don't make another oobject just use that one, to minimise the number of used assets and the app size and the loading time.
    • don't use text object use sprite-font instead.
    • some proprities are helpful , like pixel rounding , enabling opengl , not clearing background, fullscreen scaling.
    • try not to make more than 100 event in eventsheet.
    • there are some very helpful features in C2 like importing eventsheet into other layout. and making groupes and functions when you don't need some event tests to happen yet just put them in a inactive groupe and activate them when needed the same for function when you need some some actions to happen in my conditions just put them in a fonction and call it when you need it.
    • use as less physic as you can you know it need a lot of mathematic calculations.

    and finally in export process don't forget to compress Png even brute compression isn't bad C2 suggests normal compression because it takes less times i didn't have problems with brute compression. and don't export to phonegap it kills the game performance.

    when you make project be sure to do all the above and i'm sure it's going to be fine.

    ohh i mostly forgot , don't forget to destroy objects outside of layout or when it not needed anymore. some people spawn a lot of objects like in autorunner the obstacles will randomly generated and keep moving until they leave the layout view. it's not helpful at all t have 100 ojects keep moving to the infinity , and the apps makes the calculations for them while you don't need them anymore.

    i hope this helpful , i'm sure you have read the performance tips in the tutorial but i have mentoned other things that might be very helpfull too.

  • stackoverflow.com/questions/94037/convert-character-to-ascii-code-in-javascript

    Add the browser object and use these expressions to convert over and back.

    Browser.ExecJS("'"& char & "'.charCodeAt(0)")

    Browser.ExecJS("String.fromCharCode("& ascii &")")

    it works man , thank you very much ^^

  • because then when i get the animation name it will always give me the same text because the sprite doesn't have the option to give you the animation name at an index , it's just give the current animation name.