Taweel's Forum Posts

  • Thanks jeffige for the answer. If I do that based on trial and error, I would have to try it in each level/wave combinations and with the various tower types. Even then, it will not guarantee 100% same effect as at speed =1.

    I wonder why time scaling the whole game didn't work? In theory it should work because the change in scale affects all the elements.

  • Hello all,

    I am working on a Tower Defence game and usually those games have a button to fast forward (speed up the game). I want to add one to mine and the first thing I thought of, was to have a button that toggles the time scale between 1 and 2. Unfortunately, the game plays differently when time scale is set to 2.

    In normal speed (1), four towers were enough to clear the wave, but when speed is (2), not even 7 towers were enough.

    I am not sure why that is. As far as I understand, the time scale should affect the towers and the enemies alike.

    Is there a way to make this work?

    Many thanks in advance.

  • Thank you very much BlackHornet. Works perfectly.

  • Hello all,

    I have three objects that spawn enemies. I want to store the enemies in an array. The array will be 3D (Level, wave, enemy type).

    The spawner objects will look into the array and depending on the current level and wave, they'll spawn enemies specific to that level/wave combination.

    I want the three objects to use the same function to spawn enemies. I thought if I could create three copies of the array and have an instance variable to differentiate each array from the other, I could use the same function to spawn enemies (because the array will have the same name but the instance variable will have a different number).

    Is this possible? I tried dragging the array to the layout to create a copy but that didn't work.

    Thanks.

  • I tried the solution suggested by Asmodean. It does remove the vertical lines but now there is the problem of a 1 pixel separator between characters so my characters never fully connect. I am using the excellent "Sprite Font Generator by BlackHornet. It creates the characters left justified with a (1 pixel wide) column of empty pixels to the left of each char.

    Setting the width of each char, tells "Construct 2" how wide is each character. Is there a way to tell the Spritefont to ignore the "1 pixel column"?

    I tried moving the characters to the edge of the cell (shifting them one pixel to the left) but that brings the old problem back

    If it can't be done, I'll have to live with either the gap between chars or the vertical lines. Not sure which one is less professional.

  • Thanks Asmodean. Such an important aspect of the SpriteFont should be added to the manual.

    I'll try the solution you suggested and if it works I'll mark the subject solved.

  • Hello all,

    I have been trying to use the spriteFont to show Arabic letters. For some reason, it seems to add random vertical lines at the side of some letters. I have searched the forum for similar issues but the only post that I found was related to scaling. In my case I am using a scale of 1.

    In the image below the red lines point to where the spurious lines are appearing:

    If I change the zoom levels in Chrome, the lines change position.

    I have put a capx and the spriteFont png on oneDrive here:

    https://1drv.ms/f/s!AsobMPtnfQiBgSqATVvT6kN3eR7p

    Has anyone seen a similar issue before? Am I using it wrong?

    Does the spriteFont object assume that characters have a space between them (most Arabic letters connect together). Any help on this is highly appreciated.

  • Thank you very much PixelPower,

    I changed the wait to zero seconds and it still worked fine and fast.

    I also tried the same with a "mouse" object instead of the "touch" object and it was the same.

    Is this a bug or is it the way the system works? I am new at this so I don't want to report something unless I know for sure it is a bug rather than a misunderstanding of the way the system works.

    Thanks again

  • Hi PixelPower,

    Thanks for the reply.

    What I wanted was:

    When I click on RED, it turns Blue and when I click on BLUE it goes back to RED, etc.

    Your CAPX file changes BLACK to BLUE but it doesn't allow the change back to BLACK

    I amnot sure if you were able to see the image I posted (it doesn't seem to show on my browser!!)

    Have a look here:

    https://justpaste.it/yme4

    Regards.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello All,

    I have two sprites (red and blue).

    I start with 3 red sprites on the layout. When I click on a red sprite, I want it destroyed and a blue sprite to be spawned in its place and vice versa. I tried the following:

    But I end up with all blue sprites. Once they are blue, they never go back to red. If I change the order of events, the opposite happens.

    I am assuming that the "touch" event is being triggered for the newly spawned object. I am right? Is there a way to prevent that?

    Many thanks for the help.

  • Thanks 99Instances2Go. The link you provided is a great help.

    I think the "How events work" page in the manual needs to be updated to include some information about that.

  • Thanks 99Instances2Go. Your solution seems to work.

    I am still not sure why adding an unrelated behaviour or changing the width makes a difference in this case.

    I am interested in learning more about "root-events" and when can object properties be accessed after creation. Is there a section in the manual about that?

  • Thanks again Gmoney. I did check that Red and Green are NOT solids.

    Could you please add "Destroy outside layout" behaviour to yours and try it again? On mine that seems to break it.

  • Thank you very much for that capx Gmoney. It helped a lot.

    Your example works fine while mine (which is exactly the same) doesn't. After spending some time comparing the two files I noticed that your Pink sprite is smaller than mine. I tried making it bigger and it stopped working!!

    I tried several width/height combinations and it seems to work fine for width less than or equal to 15. Anything bigger it doesn't work. Height doesn't seem to matter.

    A sprite with width 20 should easily pass through that path.

    What I need to know now is why is this happening with width greater than 15?

    Why does making it "solid" matter for path finding?

    Why is it not the same for height?

    Any thoughts on this are highly appreciated.

  • Hi Gmoney,

    Thanks for the reply. I am not trying to find a path in solids. I am trying to make my enemy sprite "solid" then do "find path behaviour".

    Here is an image of my level/events:

    jpst.it/N25y

    The blue lines are solid.

    Red sprite spawns Pink sprite

    Pink sprite tries to find path to Green sprite.

    This works fine if Pink doesn't have "Solid" behaviour. As soon as I add "Solid" to Pink sprite, it stops working!!

    Does path finding not work from solid objects?

    Thanks again.