Toby R's Recent Forum Activity

  • I never had such problem so I'm not very familiar with this topic, but the first thing that came to my mind was pixel rounding project property. Do you have it ON?

    From the manual:

    [quote:3s84v972]Pixel rounding

    By default Construct 2 objects can be drawn at sub-pixel positions, e.g. (100.3, 200.8). If the browser is using linear filtering, this can make fine pixel art appear blurry. If Pixel rounding is set to On, Construct 2 objects round their position to a whole number before drawing, e.g. (100, 201). This prevents any blurring, and can also prevent "seams" appearing on grids of objects. Note this does not affect their actual X and Y co-ordinates, which can still be between pixels - it only affects where they are drawn on the screen.

    https://www.scirra.com/manual/66/projects

  • There is some old discussion about that. I haven't tested it but you might find it helpful https://www.scirra.com/forum/publishing-on-google-play-50mb-limit_t105998.

    Also in this discussion shinkan rised a suggestion

    Yeah, possibility to add extensions in C2 would be really nice.

    Google Play allows you to upload 50MB size APK and 2x2GB size extension files which should contain media files and all assets. This would be really nice to have sucha possibility, because at the moment we are kinda limited to 50MB where nearly half of that takes current Crosswalk (14) version.

    Ashley, is it possible to implement this in C2 or it's more like Intel XDK case? And if it is, can you tell us if you guys have it in plans for C2 or at least for C3?

  • I don´t have C2 around currently, but you could set the animation frame to "int(random(x))". That generates a random number between 0 and X.

    "int(random(x))" will generate a random number between 0 and X, but 0 and X will have 50% less chances to be generated comparing to all the numbers in between.

    It's better to use "floor(random(x+1))" if you need a range between 0 and X.

    OR

    "floor(random(b-a+1))+a" if you need a range between A and B.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • "floor(random(b-a+1)) + a"

    This gives the most equal chances to return an integer number from "a" to "b" (including them).

  • But you haven't describe what exactly problem do you have?

    First one is spawning.

    Spawning an object you can do by System -> Create object or by some sprite object -> spawn object.

    I need to spawn a car at random 1-3 seconds...

    You can use "Every x second" or any other loop with "wait" function, but there is a special way you have to build a delay between iterations. You can learn it here: https://www.scirra.com/tutorials/723/using-wait-in-loops.

    Regarding random function, the most precise is the following format: "floor(random(b-a+1)) + a" which returns an integer number from "a" to "b" (including them).

    and also spawn different types of cars (as I have different coloured cars and I don't want them to be the same).

    If the only thing which differs is the color then I encourage to use one sprite and put various cars as separate frames.

    Second thing is stopping. once the first car is stopped, the car behind goes ontop. I know I could put collide but I want there to be a gap inbetween the two.

    Well this really depends on how exactly your game works. You can for instance check the distance between car1 and car2 by X and Y position.

  • I'm 99% sure objects in family are reference to the oryginal objects, not their clones. Reference takes literally several bytes so it can't affect performance even if you have hundreds of thousands of them in your project.

    But I might be wrong, and C2 developers made it differently for some reason. If you have time you can test performance with - let's say - 100 different objects doing something in every tick loop. First test it without family and then put all of them to the family and run the loop again. If there will be no difference in FPS for 100 objects then it's ok I think.

  • Glad I could help .

  • Have you built it with Crosswalk? And have you uploaded both ARM and x86 APK's to Google Play? 270 devices sounds for me like you have uploaded only x86 APK.

  • For the random number it is better to use "floor(random(b+1))" (or "choose" function if you don't have many numbers to choose from) instead of "round(random(a,b))".

    round(random(a,b)) does not generate numbers equally, border numbers (a and b) have 50% less chances to be generated than the numbers between "a" and "b".

    EDIT: it should actually be "floor(random(b-a+1)) + a" if you want a range between f.ex. 5 and 10. What I've mentioned before is for ranges starting from 0, like 0 to 10.

  • You can use any loop, but there is a special way you have to build a delay between iterations. You can learn it here: https://www.scirra.com/tutorials/723/using-wait-in-loops

  • You can do a workaround with a small PHP script.

    <?php
    header("Access-Control-Allow-Origin: *");
    $rss = file_get_contents('http://undeadbobop.blogspot.com/feeds/posts/default');
    die($rss);
    ?>[/code:qkpa54jm]
    
    Now you can grab your PHP file with AJAX in C2. The result will be the same.
    
    EDIT: I'm sure both solutions will work on most of free PHP servers.
Toby R's avatar

Toby R

Member since 23 Mar, 2015

Twitter
Toby R has 18 followers

Connect with Toby R

Trophy Case

  • 9-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • x6
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

15/44
How to earn trophies