A problem whit an enemy

0 favourites
  • 4 posts
From the Asset Store
Give Sound to the enemies that are part of your game! :)
  • The enemy sprite 1258 is supposed to move in different directions. But rigth now it just moves in 0 degrees and never changes direction. I have tested it alot and it always moves in 0 degrees purely. I doesn't have anything in the event sheet that specificly would make it move more in 0 degrees then any other angle so i don't know what to change. This is about a advanced enemy behavior so it could be hard to solve but i would be glad if anyone could. So here is my project. I want you to make it so that Sprite 1258 does not just move in 0 degrees basically. You don't need to figure out how the enemy is supposed to move i just want you to make it move in any other way then 0 degrees. And please don't say something like, your project takes up to much memory and is to massive for anyone to look into. I didn't want to make a seperate file to show off the problem so please try to look into the full project.

    https://www.dropbox.com/s/4ks20oboupgz8 ... .capx?dl=0

  • I can't make a seperate file everytime i have a problem whit something. So if the fact that my project is too massive is the reason why no one is replying, please try to ignore that fact and still look at my project. You will start at Layout 50, the layout where the problem is. The problem sprite is Sprite 1258. If you search for Sprite 1258 in Event Sheet 4, you should find all events related to it. You can also help whit making my project takes up less memory if you can. I have done my best to make it take up as little memory as possible.

  • It (1258) is moving. With a speed of 100 as set in its Bullet properties.

    Its bullets angle of motion gets changed when its instance variable 'direction' is set to some action in a str.

    Instance variable 'direction' is a random choice when instance variable 'direction2' is some action in a str.

    So far i am with you. Besides that it is a complex system and it is impossible to know if you made a typo in there. Bet lets assume you did't.

    Instance variable 'direction2' gets its value based on the relation between 1258 and sprite43. Sprite43 seems to be the player and has the platform behaviour.

    There are 2 events covering this. But i was stuck allready on the first one.

    That first event starts with a pick by comparing: abs(Sprite1258.X-Sprite43.X) = 0

    Meaning, when they almost are exact on the same place (on the X axes).

    But 1258 moves to the right, as a bullet. Can i move 43 and have it on practical the exact X as the always moving 1258 ? Hmm, is that even possible ? I made cap and tried this. It is like impossible. You could have done this for yourself.

    So that event can only be true if the player is played by a supercomputer. In my opinion.

    Then the sub events. 2 Groups. But i only need to look a the first group.

    That first subevent: A compare 1258's X when its X > Sprite43.x then ...

    Since this also had to meet the previous topcondition abs(Sprite1258.X-Sprite43.X) = 0, that gives maximum a difference of 1/2 pixel between 43 and 1258 to compare for. Wich is, i have to admid possible. But the subevent on that ....

    Again a comparing of the 1258's, this time if its X = Sprite43.X+600. I had to read it 5 times. Really ? Its X = Sprite43.X+600 ? Not ">" or "<" but '=' !

    So if 1258's X (wich is a moving bullet) is exacty Sprite43.X+600 (wich is a platformcontrolled object) then set direction 2 to some action ?

    So lets do the math. Lets say i am able to catchup the bullet 1258 with a platform based 43. In way that abs(Sprite1258.X-Sprite43.X) = 0. Meaning. In a way that their X's differend less then a pixel. Lets assume that it is possible. So Sprite1258.X = 10.2 and Sprite43.X = 10.1

    Then the sub event: Is Sprite1258.X > Sprite43.X ? ah yes it is. Its is 0.1 PIXEL bigger.

    Next sub-subevent: Is Sprite1258.X = Sprite43.X+600 ? Uh. No. not in a lifetime. They should be practical at the same place to meet the top condition.

    Well i feel dumb for looking at this. And in a last resort i renamed 1258 to "CockyOne". But that did't work either.

    Greetings.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's hard to ignore the size when it's 1Gb. Even 20Mb is big by my standards and I typically won't download it.

    Maybe make a copy of your project and remove all the audio and video files from it and upload that?

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