briggybros's Recent Forum Activity

  • You could use the function object to make a function which does it taking parameters.

  • If your sprites have many animations families would be better. I only really use the frame method for static objects.

  • You could make all of the characters the same sprite and have different animation sets for each character.

  • So there are many fancy algorithms out there for generation. But I'll try to make a simple one work.

    First you're going to want to randomly place your objects (planets and stuff) in your infinite level. There is your first problem, you cannot simply write 'Set Position (random(-8, 8), random(-8, 8))' since 8 is not a number. So what you could do is generate it relative to something else, the spaceship for example. You could give the spaceship 4 instance variables, maxX, maxY, minX and minY which represent how far the ship has travelled in any direction and when it get close to one of its boundries, simply generate more planets with say random(maxX + 100, maxY + 100) or something similar. So the universe is procedurally generated. This method is still not ideal as if done right it will take a lot of processing power the more the ship travels, and if done wrong will leave you with huge patches of empty space.

    Now I don't know if you've ever played Minecraft, but we can learn something from its procedural generation methods. You can split your infinite universe into an infinite number of 'chunks' with finite volumes. When the ship gets close to ungenerated chunks it generates those chunks. You will need to store these chunks in an array and load them and unload them as you see fit. NOTE: Having too many objects loaded at a time will cause performance problems. You can create a variable called render distance, which takes an integer larger than that of half the screen, maybe double that. Then you can set up an equation for a circle using this render distance as a value. If any chunks fall into this circle load them (if they do not exist generate them), if there are chunks outside of this circle save them and remove them.

    Generating a chunk

    Say you want 2 planets in every 200 square pixels you can make your chunks the size of 200x200, then when you require to generate the chunk from the above method you can simply spawn 2 planets at any coordinates between 0 and 200 for both x and y. To place the planets properly the coordinates would be chunk.minX + genX and chunk.minY + genY. So the planets are only positioned relative to the chunk. The chunk has finite coordinates which can be assigned incrementally.

    Then you can have different types of chunk etc to have variety where the generation properties are different and then conditions about where they can spawn etc. It depends on what level of complexity you want.

    I hope this garbled explanation helps in some way.

  • Yes, point 3. I would go with standard HD and scale down. You will lose detail on, but I guess it's better to show less of good quality than more of bad right?

  • Right, I've got it to a working point. See the comment in the Event Viewer. Ask any questions you may.

    EDIT: So it turns out Kyatric got there first, what he explains is what I've shown (plus a little tidying)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm trying to test out real-time multi-player capabilities, but I cannot get passed the input state. I have set logging so that when the 'set client input state' action is called it outputs the inputs. When the client views their log they can see the inputs they have made. However, when the host looks at their log, there is no acknowledgement of any client input.

    The method is as so:

    but the function appears never to be called.

  • bump

  • Generate a random number and store it in the first three cells of a 6x1x1 array. Then generate another number, check it's not the same as the previous, if so generate another (do this recursively until you get one), insert it into 4th cell. Do the same for the 5th cell. Check if cells 4 & 5 are equal, and store their value if they are. Generate the final number, checking if it is equal to the first three as above. Also, if 4 & 5 are the same, also check it's not the same as that number. Then you can 'shuffle' the array or whatever you want to do.

  • You should make the probability of getting the intended outcome 100 times less than the desired percentage. Then you can just you a random and let probability do the rest.

  • So, yes, you're going to need to store the variables. I've not worked with physics objects since Construct classic though. I assume that only the velocity is lost on this time freeze.

    Have two instance variables in the object labelled velocityx and velocityy or any other names which mean the same. When the time is frozen, set the variables to the objects x velocity and y velocity. When time is resumed, use the object.setvelocity using the parameters of the stored velocity x and y.

    This works because a velocity can be split into its components, in however many dimensions you are working with. In this case we are on a plane so we need to consider only x and y. Using trigonometry we can look at an objecs velocity in terms of a line, where the length of the line is the velocity and the direction the line is pointing is the direction of velocity. Since the line is straight and in the plane then we can calculate the velocity in both x and y velocity. This is also true in reverse with the overall velocity equalling sqrt(vx^2 + vy^2) which is synonymous with pythagoras' theorem.

  • I don't think so, no. You can download sound and images from the internet and use them, but you need to install a font, I assume that is where the difference lies. However, it might just be possible to turn your font into a webfont somehow?

briggybros's avatar

briggybros

Member since 7 Mar, 2011

None one is following briggybros yet!

Connect with briggybros

Trophy Case

  • 13-Year Club
  • Email Verified

Progress

14/44
How to earn trophies