brunopalermo's Forum Posts

  • Then, I guess we're not getting what you want.

    I thought you needed the bullets to come out equally spaced, no matter if you're moving left, right or not moving at all. That is what my example does. If it's not what you're looking for, it would be nice if you could explain better, then...

  • Hey NN81,

    Here you go. This is basically what dop2000 mentioned earlier.

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

    I increased the width of the layout so you have more room to actually see the shots. Also, I'm destroying the bullets when they travel at least the minimum distance between bullets outside of the layout. Because we need the last bullet to be alive in order to calculate when to spawn the new one.

    Hope this helps. Cheers!

  • Hey frayt!

    If you want to create an Assets layer to store all sprites and them load them from there, to use in other layouts, you don't need that layout to have an event sheet, nor you need any special code. Just put all assets in one layout and you're done.

    When you need to create an instance of anything that's there, just create it normally.

    See this capx:

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

    I created a layout with 3 objects: a sprite, a particle and a text. Then, from another layout, I just randomly create one of the 3 every 0.2 seconds.

    Hope this helps. Cheers.

  • Yeah. Right now I'm working on structure and content. I thought of something like the list below:

    1. Interface: Show them the general interface of the program, specially properties, layers and projects windows.

    2. Layouts & Event Sheets: Explain what layouts and event sheets are and how they relate to one another.

    3. Objects: What are objects and how to add and use them.

    4. Events & Actions: Show the trigger structure of construct with the events and the actions they trigger. Explain the top-down execution.

    5. Global & Instance Variables: What are variables, how to use them, the types of variables and differences between local and global.

    6. Behaviors: Adding behaviors to objects and setting them up.

    7. Templates & Examples: What are them and how to use them.

    8. Best practices: A miscelaneous selection of things that will make their construct projects more efficient.

    9. Community: Show them this forum, how to get help from people around and where to find new plugins and behaviors.

    I guess this will be the content for the course. My idea is to teach each of these aspects while making a game. I'd rather not use the top-down shooter, since they can find that everywhere. Maybe remaking a well-known simple game would be a better option.

    What do you think?

  • The condition "If dist <= 32" must be OUTSIDE the function. Right now it just checks the dist at the moment the objects are spawned and, obviously, it's bigger than 32 at that moment.

    Something like this: https://www.dropbox.com/s/kg0jiaacdq90i ... .capx?dl=0

    Hope this helps. Cheers!

  • Containers only mean that a bunch of objects will be created and destroyed together. It doesn't position then relative to one another (you have to do that separately) and it doesn't "link" their stats together (you'll have to set opacity, visibility or layer for each of them separately).

    If you have several menus that use similar elements, the way to go is to create a function that dynamically creates the objects and sets them up. If you have fewer menus and limited variation, maybe a better approach is to have them pre built and control only visibility dynamically.

    It's hard to tell which approach is best without seeing a capx or knowing exactly your use of menus in this specific app/game.

    Hope this sheds some light on the issue.

    Cheers.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It would be good to know exactly what you need to control. Can you share a capx or explain in more detail, please?

  • This tutorial is very detailed: https://www.scirra.com/tutorials/1337/e ... onstruct-2

    And this site may help you test your regex: https://regexr.com/

    If you need something more specific, give us more details about it or share a capx that I'll be glad to take a look at it.

    Hope this helps. Cheers!

  • If you could share your capx I could take a look and see what's wrong with it...

  • I just added coins to the autorunner example... Is this what you were looking for?

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

    If I were you, I'd tweak the jump. Maybe lower the strength and play a little with jump sustain or double jump... I don't know. Giving the players a bit more of control to catch the coins would be nice.

    Hope this helps. Cheers!

  • Hey Jayyyyde!

    Not sure that's what you need. In this capx you can control the player with the arrows. The cannon will shoot a bullet every 3 seconds. Each bullet will follow the player for 2 seconds, then, stays in a straight line until it leaves the layout. Bullet speed is slightly higher than player speed.

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

    Hope this helps. Cheers!

  • Hey yolkgames!

    I'm not sure I understood what you wanted. You want to move the character only horizontaly, no matter where you click the mouse, right?

    If that's the case, here's the capx.

    https://www.dropbox.com/s/5px2blkve0h9m ... .capx?dl=0

    If I've misunderstood, just let me know and we'll fix it. Hope this helps. Cheers!

  • I used this solution for a laser beam:

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

    I'm guessing you can reuse this technique of stepping back in a loop for any object.

    This is probably the most efficient way of doing it, by the way. Way to go mekonbekon!

  • Say, when a spaceship hits an asteroid and you want to draw sparks in the spot of the collision

    What I meant was it's something that would only be useful in some damn specific contexts. Depending on the size of the spaceship and the asteroid, it wouldn't even be necessary this kind of precision... Sounds overkill to me.

  • Also, for a irregular shape, such a thing would consume an awful lot of cpu power... And I really can't see how useful would that be.