Ashley's Recent Forum Activity

  • Faggatron is right, angles can be outside the 0-360 range - 365 degrees "wraps around" back to 5 degrees again, because it's one full rotation plus 5 degrees. Same goes for negative, etc. If you want to display the result, add 180 to it Also, distance will give the distance in pixels, and if you're passing object coordinates, it will measure from their hot spots.

  • Yeah, I've read Firefox 3.1 will have an even faster javascript engine. But it's nice that this is spurring on competition. Maybe even Internet Explorer will get a faster javascript engine, it seems to be lost in the dust kicked up by Mozilla and Google right now

  • Are your sounds WAV files? The DirectSound object doesn't support MP3s, if I'm not mistaken.

    The samples on channels only support PCM WAVs, but the 'Play music' action supports MP3, WMA, anything Windows Media Player does.

  • oh yah, whats the distance/anglething do, never seen it before

    and are there more of them?

    All system expressions can be found by double clicking the system object in the object panel in the parameters dialog - or look up 'System Expressions' on the Wiki.

    If you have two points - (x1, y1) and (x2, y2), distance(x1, y1, x2, y2) gives the distance between the two points, and angle(x1, y1, x2, y2) gives the angle between them.

    I'll come back to this when I have an internet connection installed in my house!

  • WHAT?? I had no idea. I've done some reading, and I think I might be able to tweak it to use the Directsound emulator in Vista, but it will have very limited functionality (just stereo output as far as I can tell). I think I'm going to have to write a new XAudio2 plugin, which is the new sound API from Microsoft - but I've looked at it before and several effects and features from Directsound are missing in XAudio2.

    This is annoying!

  • The way normals can be calculated is by moving objects in a circle. If a ball, say, has collided with the edge of an arbitrarily shaped sprite, you can move the ball out by a radius (16 pixels works OK) and then collision test in a circle (say, at 4 degree intervals). By working out the average angle of the overlapping angles, you can calculate the approximate angle towards the surface, and inverting this gives you the normal.

  • It was made a long time ago in a very early beta. I think it needs a lot of work - as you say, I don't think anybody's made a real card game with it, so it doesn't really have a good way to handle the graphics and gameplay of a card game.

  • It is possible to calculate an approximate normal to the surface of something. The ball behavior does this internally, and I wrote some of the code for it. However, it's complicated and I'm sure you don't need it here.

    You should probably adopt a system a bit like the 8 direction movement's engine. The algorithm works like this:

    Attempt to move in X direction

    If X direction is blocked by solid, move back to original position

    Attempt to move in Y direction

    If Y direction is blocked by solid, move back to original position

    This per-axis check means if you are blocked by something, you can still move along the unblocked axis. It might not work perfectly for all shapes and sizes of wall, but it seems to do the job for the 8 direction movement. It is also a suitable solution... the normal detection algorithm might be quite tricky in events, and is definitely overkill for something this simple.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This would be a nice feature. In the meantime, here's the maths you need.

    When A collides with spinning B and you want A to stick on to B, first calculate the distance and angle offset from B to A and store these in private variables, eg.

    Set 'dist' to distance(B.X, B.Y, A.X, A.Y)

    Set 'ang' to angle(B.X, B.Y, A.X, A.Y) - B.angle

    then, from then on, always set A's X and Y co-ordinates to

    B.X + cos(A('ang') + B.angle) * A('dist')

    B.Y + sin(A('ang') + B.angle) * A('dist')

    I can't check this works right now but its the right idea. Some kind of 'Stick' feature would definitely be useful instead of this though.

  • Events will very rarely be the bottleneck of your game. Almost always, you can assume the rendering is going to be what slows your game down, if anything.

    Read the article - it explains how quite often the events will actually have zero impact on your game's performance.

  • I've just moved in to my new house for this year of uni. However the internet isn't installed until wednesday. I'm on at the library right now, but hopefully back to normal soon! (I'll try not to suffer any withdrawal symptoms)

    Has anyone seen that episode of South Park? "I'm gonna head out west, find me some internet..."

  • Parallaxing is a good way to go - if there are 3 levels of scenery moving at different speeds when the screen scrolls, you get a much better feel of depth than a completely flat level. Dropshadows (use the Dropshadow object, not the effect, it's faster and doesnt use pixel shaders) can also add some depth too.

    Blur horizontal/blur vertical are the two slowest effects. I'd avoid them except where absolutely necessary if you can. They can be optimised though and I'll try to do it soon.

Ashley's avatar

Ashley

Early Adopter

Member since 21 May, 2007

Twitter
Ashley has 1,765,545 followers

Connect with Ashley

Trophy Case

  • Jupiter Mission Supports Gordon's mission to Jupiter
  • 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
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • Forum Mega Brain Made 20,000 posts in the forums
  • x125
    Coach One of your tutorials has over 1,000 readers
  • x74
    Educator One of your tutorials has over 10,000 readers
  • x5
    Teacher One of your tutorials has over 100,000 readers
  • Sensei One of your tutorials has over 1,000,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • x42
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

32/44
How to earn trophies

Blogs