EpicRaid's Recent Forum Activity

  • Thanks! What does 'n' do/mean though?

  • I couldn't find anything about this. I tried comma separated numbers but it doesn't accept it.

    Thanks.

  • Hello,

    When testing my game on desktop/Chrome, the audio works fine.

    But when testing on my iPhone 5 SE, using Safari or Chrome, the music runs fine, but the audio effects are distorted and very low in volume. While on desktop it has normal volume and sounds just fine.

    I've tried all kinds of things, but I'm unsure what is causing the problem.

    My iPhone runs other audio effects from other games just fine. I was wondering if bitrate could be the problem. The sound effects have a bitrate of 1411 KBPS and are less than a second long.

    I've no clue where to look for anymore.

    I tried playing the sound effect on trigger once, or on touch end.

    Thanks.

  • Thanks. That's good to know. I will use floor from now on or choose, those seem to be the most easy to remember.

  • Yes, I meant when the red sprites were overlapping.

    OK, so I just used many layers and some global variables to call them on seperate layers. That works. Setting each layer to force own texture.

    I couldn't find that specific masking effect on that topic though.

    Thanks for your help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That formula for RND is wrong. Values 2,3,4 will appear more often than 1 and 5.

    Why is that? I also use this type of 'odds' technique now and then.

  • Hey, that's great news!

    Saved that .capx from R0J0hound for future reference ;)

  • Hiya,

    Ah yes, I understand exactly what you mean. I can't come up with anything for that at this moment though. I myself am still a learning programmer, so I don't have any ready solution like that expression.

    The calculation of the distance seems like the starting point. It's just that when the X and Y are both taken into account, the problems start.

    But perhaps you could reference someone, for example I know dop2000 is a helpful and capable programmer. Or alternatively, wait for someone else to reply.

    I'll try to get back to you if I can think of something, but I'll also be busy trying to figure out some stuff for my own games :P

    Sorry I can't be of help.

  • Hey, thanks!

    That works great. I did notice however that when the sprites are overlapping eachother, the shadow is visible on the other sprite. And thus not cut off in that case.

    Is there a solution for this?

    Also, this might not be entirely related, but I also wanted to prevent overlapping when the sprites are created. Basically the sprites are randomly created from four sides (left right top bottom), sometimes they spawn in almost the same place, there are three sprites spawned each time from a side.

    I'm thinking using some sort of 'solid' or physics technique, but I think this will have unwanted effects. They're just simple bullets that always move exactly towards the center of the screen (as they're supposed to).

    Thanks again.

  • OK, perhaps I should clarify.. this is what I'm wanting to achieve in Construct 2:

    Thanks!

  • Here's a mockup; again, I'm no expert in AI, but hopefully it'll get you started:

    The enemy will fire and/or move 5 times. Just hit F5 to see randomization of movement and firing.

    Preview: mediaconceptfactory.com/games/capx/Tanks

    Capx: mediaconceptfactory.com/games/capx/Tanks.capx

    Edit: I forgot to mention; have not calculated in the distance measurement. But it starts with:

    System > Compare two values > distance(PlayerTank.X, PlayerTank.Y, EnemyTank.X, EnemyTank.Y)

    If e.g. this is greater, less, etc. than 'x' pixels. Then apply actions.

    - R

  • Hiya,

    I can't say I'm an expert on AI, but I think you could first calculate the distance between the tanks. This is easier when both tanks are on equal height.

    Then, you could do some testing with how much strength the projectile is shot. So, start off with x amount of strength. I think you can also use a bullet behavior for the projectile, it has gravity.

    So basically say: if distance between playertank and enemytank is exactly 100, it will fire with 20 gravity. If distance is 200, fire with e.g. 10 gravity, and try to apply enough gravity to the projectile bullet to exactly hit the other tank. I *think* if you can find the extremes you will be able to set the other gravity calculations for the projectile that are in between.

    With extremes I mean maximum possible distance between tanks and minimum.

    Then, you could apply a randomization to the gravity of the enemytank. So it won't always exactly hit you the first x tries. You could gradually decrease the AI randomization value with each turn; enemytank is learning and will aim better and better.

    Now this approach might take a lot of manual programming, I'm sure there's a way of automating although I can't tell you how on the spot.

    Also, with each turn, you can have a variable randomly (rounded) calculated to calculate odds. These odds with each turn will decide if the enemy will move, left, right, how many pixels. You can apply randomization to this as well.

    I'm just thinking about this as I type, hopefully it'll give you some ideas.

EpicRaid's avatar

EpicRaid

Member since 13 Feb, 2015

Twitter
EpicRaid has 17 followers

Trophy Case

  • 9-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • 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
  • Email Verified

Progress

18/44
How to earn trophies