Ashley's Recent Forum Activity

  • Does this example help?

  • The RTS behavior has an implementation of A* pathfinding which is pretty good for navigating around complex maps. There's also stuff like intelligent aiming you might find interesting (see the attachment further down the thread - the maths in the original file has since been built in to Construct).

    Construct's event system is also very capable of coming up with an AI system. It is, however, entirely up to you to code it. Quite often questions along the lines of "How do I make AI?" are asked, which is too vague to answer. I think you can make a fairly good AI system in a much simpler way than most people think. All it is is automatically controlled enemy characters - it's easy to come up with some simple rules that make them interesting enemies in gameplay.

  • Yes, as you would expect the distance() expression uses the Pythagoras theorum as you have written. I'm sure it's working correctly, and it just returns the distance between two points - which is always positive and is unrelated to quadrants. I've used it for several things now and it works fine as far as I know!

  • using fast loops and one problem arised, it has to be very precise to work properly, meaning it needs to check every pixel step, and it lags the system having to do all of these checks, also if something gets too far lodged into another object it would run a continuous loop

    Yes, you have to do a lot of collision checks - doing this with the interpreted event system isn't going to be anywhere near as fast as the C++ implementation in the Construct runtime. Maybe it could be a system expression.

    Still, I like the idea of all objects having an editable 'hull' - a polygon you can draw around it. Both Physics and the dynamic lighting engine need a polygon instead of a bitmap mask and it would save you entering the same polygon twice. And a 'vector' collision alternative for Sprites could actually be fairly handy, but that's less of a priority. Animated sprites would make this a little trickier though... maybe it should be in the picture editor...

  • Yeah, atan will only give results over a range of angles (I forget, either just 0-90 or 0-180) which is kind of inconvenient if you want to measure an angle which is actually 270 degrees. Still, the C++ runtime library has a function called 'atan2' which works out the quadrants for you, which is what Construct uses. If you ever need atan2 for something else, I think angle(x, y, 0, 0) is equivalent to atan2(y, x). But the x,y and 0,0 might be the other way round. Can't remember.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

Ashley's avatar

Ashley

Early Adopter

Member since 21 May, 2007

Twitter
Ashley has 1,427,631 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
  • x108
    Coach One of your tutorials has over 1,000 readers
  • x62
    Educator One of your tutorials has over 10,000 readers
  • x3
    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
  • x36
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

32/44
How to earn trophies

Blogs