SOLVED

0 favourites
  • dropbox.com/s/pue4cfgz75v4lzq/walkingtotheleftisexciting.capx

    What is supposed to happen:

    Each second, a slime will go into one of the directions:left, right, up,down, or it will stand still. Each of these actions have a 1/5 chance of happening. However, what happens is, all the slimes go to the left for 1 second and stop... forever. What am I doing wrong?

  • Random doesn't produce whole, rounded numbers.

    This means that random(4) will give you anything from 0 to 3.999r, with 1.89237783 and 2.12301203 and everything else in between. You should use round(random(4)) to get a whole random number from 0-4.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • let people see your game on the scirra arcade so they can try to help instead of going to random sights

  • Posting the .capx itself is way better, you can see the code with .capx and find out what is going on, and downloading the .capx is less time consuming for everybody including me than post it on scirra arcade. See that link?

  • Random doesn't produce whole, rounded numbers.

    This means that random(4) will give you anything from 0 to 3.999r, with 1.89237783 and 2.12301203 and everything else in between. You should use round(random(4)) to get a whole random number from 0-4.

    Thank you!

  • sosensible, uploading to the Arcade is a waste of time for these quick fixes. People much prefer to download the capx directly from Dropbox - it's hardly a random site :P

    fassFlash, my pleasure.

  • yes but one person uses drop box and another person uses another site and people don't always like jumping from sight to sight

  • GeometriX

    fassFlash

    using round(random(4)) will give a slight bias to numbers 1,2,3

    for example to return 0, it needs to be between 0 and 0.5, but to return 1 it needs to be between 0.5 and 1.5.. which is more likely

    doing int(random(5)) will give the same chance for each number 0 to 4

  • keepee, ah, cheers for that. Makes sense.

    sosensible, Dropbox is the de facto standard for sharing files around here.

  • yes but one person uses drop box and another person uses another site and people don't always like jumping from sight to sight

    So, what's better, jumping from sight to sight or being unable to solve the problem?

  • ok its just I (and probably not only I) aren't going to download files just to help out

  • sosensible, we encourage people to post capx files that they're working on, purely so that people who do wish to help can download the files, have a look through them and give suggestions based on evaluating the project, rather than simply guessing as to the inner workings of it by playing it online.

    It also allows those who wish to help to simply edit the broken capx files and re-upload them, usually with an explanation of what was fixed and how.

    While people can share their capx through the Arcade, Dropbox is by far the simplest method to upload and share these files.

  • ok

    you probably know more than I do about that stuff because you've been here longer

    who knows I might use it adventualy

  • dropbox.com/s/cg5l347e3b436cr/Arrows%20that%20can%20only%20shoot%20to%20the%20right%3F%20Imagine%20this%20in%20real%20life.capx

    I've got another problem. So I implemented randomized walking for the slimes, thank you, and made them multiply. After that, I had to kill them off somehow, so I made myself a knife. After that I decided to make a bow. But the bow works weird. Usually, a bow is shooting where you are facing, like in Legend of Zelda: A Link to the Past. However, MY arrows aren't just poorly drawn, they are also magical: they can only shoot to the right. How can I fix this? Magical arrows are good, of course, but not when killing slimes.

  • Totally legal bump

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)