zhroguexe's Forum Posts

  • any1 got any ideas?

  • I want to make a stick that starts falling left / right and every time you press a button the stick goes back to the otiginal angle.. if you press it very soon it will move there no problem but if you press the button too late the stick wont just go to the original angle, it will also move past it and go at the opposite negative angle!

    I want to imitate the movement or Mr. Muscle when he starts falling to the left / right, (check on the android app store to see exactly)

    What im doing now is:

    Every 0.1 seconds i set the sprite's angle to: balance x (1+speed)

    inside the every 01 seconds i check to see if a variable called goleftorright is 1 or 2 (1 for left 2 for right)

    if its 1 then i add the value of 1 to balance and if its 2 i substract the value of 1 to balance

    On button pressed i just switch goleftorright when its 2 to 1 and when its 1 to 2

    and at the end it sets a boolean variable to true

    After the set true is done i check if

    Variable is True and then do Every 0.1 seconds add 0.01 to speed

    On button touched = variable becomes false

    'also here i have to reset speed somehow and set it to 0 before we start counting the time it took to press the button from the last time we pressed it. Thats how i measure the speed with which the sprite will move back to angle 0 or beyond

    basically i just see the time it took to press the button and use that as a reference to the speed (the longer the time the higher the speed and so on)

    This is more or less the code i've got up to now, doesn't seem to do the job properly.. any ideas?

  • Hey guys i just finished V2 of my game (thanks a loooooooooooooooooooooot to all of you helping me here on the forums to write the code, and also thanks alot to from youtube, he has really showed me how i can improve my graphics and best make the game suitable for it's users!)

    Here's the new version, with re-drawn everything

    youtube.com/watch

    Let me know what you guys think

    For those of you who want to see the last version you can find the old gameplay trailer video on that same channel, the game is the same.. only less pretty <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" />

    Again, thanks for the support !

  • i dont know if this would work as it would with system threading on windows but you could try adding a wait 0.5 or 0.01 at one of the points in the loop to slow it down as much as you need

  • I have not used an array in C2 yet, but if its like other programming languages an array should be able to store those things, you would just need to convert them to integer (Int()) or String (str()) first to match the array type (if its string or integer) but i dont think this is an issue for C2, im under the idea that C2 will convert it automatically so you should be good

  • if you're interested about the mid thing

    Mid(string,whereyouwanttostartofstring,numberofletterstoreadfromstartofstring)

    so for example

    if we have a string called word with the value of "potatoe"

    Mid(word,1,2) would give you "po"

    you can also use Len(word) to get the number of characters in a word so you can do Mid(word,1,len(word)) to get: "potatoe"

    and so on

    Oh also if you wanted you could use the Mid thing to merge 2 parts of a string together, thats a cool trick if you want to save names and scores in the same variable

    (example:

    playerscore has saved inside of it : Playerone8

    leaderbordshowtext = (Mid(playerscore,1,Len(playerscore)-1) & " has score of " & Mid(playerscore, Len(playerscore)-1,1)

    which gives: Playerone has score of 8

    sorry if i went off topic xD

  • I asked because sometimes sprites are duplicated unexpectedly and/or some other aspects of your game/events show up that take a great amount of processing power, that could affect the fps..

    And how would you go on about seeing if this happens or not.. i mean what should you look for?

  • LittleStain Hey there man yes i have, just now infact

    why?

  • EyezWidee Hey man thanks for the reply!

    What i've done is I disabled all the collision checks that were not needed (and there were a lot!) and i've also added an option (in the settings) for the user to disable the graphics (so if its set to disabled the layer with all the details is set to invisible).

    What im interested in is the 16:9 resolution thing... i've set my game settings to have the window size of 864, 486 because that's what my phone uses and i've noticed that on some devices the screen cuts off so i think i'm not using 16:9

    For this reason i wanted to ask: How should i set up the project for a 16:9 resolution? Also i've been using the "Scale Inner" and i read that it should be Letterbox Scale.. what's the difference? (also which is better for mobile?)

    Thanks for the replies anyway!

    P.s. i Already posted this somewhere else but to boost performance i've also:

    Lowered code lines and removed unused variables, used Minify Script and also removed the millions of unused sprites in the Objects folder... so far so good! (could be better tho :p)

  • majesticAsFk Hey man thanks for the reply (and sorry for the late answer )

    First i'd like to say AMAZING name really, hahah

    And second: I did the following things to fix the overall performance:

    As you suggested i checked the resources in the final build export and there are only the used ones (construct 2 removes the unused ones apparently)

    As you suggested, again , i changed the text display to change every 0.3 seconds

    As for the minifying and variable issue i didn't know how to check the js file myself so i just went on an eight hour adventure of hunting down every unused variable!

    Also, for those interested, removing Collisions Enabled to every non player interactive sprite improves everything!

    aaaand not repeating code also helps, using a common event sheet helped me lower my lines of code from 1800 to 1055! (and i could have probably lowered it even more if i used functions and such similar magical inventions!)

    Overall achieved Fps increase and size drop, good!

  • holy crap that was fun whoa, why dont you release it for mobile as well?

  • Hey guys, this is the game i've been working on and off during this school year:

    THE GAME OF BOZ

    Here's a quick video "trailer" (if u can call it that) of the game:

    youtube. com/watch?v=p68tJGYXbpk&feature=youtu.be

    What's interesting (to me that is) about this ordinary jump platformer is that you can go up down left right, basically you can play in whatever position you could imagine (or almost lol)

    Here's the link to the Play Store (only android for now since nobody in my family has an iphone i can test it on :/)

    play.google. com/store/apps/details?id=com.giocodiboz.versionedue

    You guys don't have to download it i mean it's still buggy (not optimized for phones with less than 100mb's of ram) and i'm still working on some things, but that there is the "overall" idea of the game

    Please give leave some comments judging it so i could improve it )

    also sorry for my english..

    EDIT: sorry i cant post links, if you want to view things you got to do it the hard way, again sorry if thats a let down ugh

  • Right now i am setting all collisions properties to False for every sprite that is used as a "detail" for the levels

    I also went and decided to make 1 big shared event sheet where all the player controls are, such as movement and pausing, so the code wouldn't have to be repeated in every level's sheet

    After doing some research about further possible optimizations here are my following "Unanswered" questions:

    = I read this

    "To ensure previews are fast, duplicate images are not removed when previewing. However when exporting, Construct 2 looks for and removes duplicate images. This helps reduce the download size and memory use, since there's no point having identical images downloaded twice or loaded in to memory twice." from another thread here.

    I often used the same image (resource) but opened with in different sprite(because i wanted one block to do nothing and another to do something while they were both identical on the outside)

    Can i be assured that all the repeating objects i have won't be included in the final file size? (as in, all those sprites on the right that i imported but deleted or that i imported more than once because "noob" mistakes)

    =i read this: (regarding minifing script)

    "This renames everything possible in the javascript code to use the shortest names possible, which makes the script smaller and quicker to download."

    But most importantly

    "It may also make the resulting Javascript slightly more efficient, since it employs some basic optimisations like inlining and removal of unused code."

    Does this mean that all those Copied variables i have

    (for example: at the start i copied all my movement code, including variables, and now i have (for example) variable: canyoudoublejump2 on level2 canyoudoublejump3 on level 3 and so on)

    and that are, most probably, not used will be removed from the code thus i can just ignore them in the project and not "hunt" the unused variables since, upon exporting, they won't be an issue?

    =i read this:

    "If you have many background and graphics sprites, you can add all the images in one sprite and make the animation speed to 0 , then change the frames as you like.

    This better than using 50 sprites as background and graphics."

    Does this have a big impact on the framerate/loading overall performance or is it something done because it is more "convenient" (and i could see why it would be!)

    And a side question:

    I have a text object on all of my levels that indicates the distance of the player from the end of the level, to do this im using the distance between 2 points code i found here, my question is: Since im using the "calculate distance and put in text" code "on player moving" , does this affect the performance since every time the player moves the CPU has to calculate X1-x1,y1-y2 or is it insignificant in terms of performance drop?

  • Try Construct 3

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

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

    Really need to solve this guys so i can update the final version of the game!

  • Thanks for the code LittleStain but what im wondering is how do i know which product has been fetched

    for example

    ON sprite(btn1) touched: FETCH PRODUCT 1

    ON sprite(btn2) touched: FETCH PRODUCT 2

    ON product fetch complete

    --IS IN COCOONJS

    -----IS STORE AVAILABLE : Purchase PRODUCT 1

    How do i purchase the product based on the fetched product of the button? Since the "on product fetch complete" cant go under BTN touch

    In this example:

    How do i know if i've fetched the product from BTN 1 or BTN 2? (without declaring variables for each button and setting them to true and then doing an IF true then kind of thing, because it would take a lot of space and time for all of the products i've got)