Smileh's Recent Forum Activity

  • Aphrodite 's example is exactly what you need. You should post an example of how it doesn't work for you.

    It doesnt suit my purpose. Not saying it doesnt work, I'm saying it doesnt meet my expectations and controll over it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah, it doesnt work as I expected. I need more controll over it, something similar to what I'm doing, but I'm missing something to make it work.

    This is quite close to what I'm aiming, the problem is, it only works for one tower. If I duplicate the sprite a few times it doesnt apply to every object, just to one.

  • 1drv.ms/u/s!AjkoCSebIn9JixGkmfKK87AMBeBp I changed it so it uses an instance variable (called fire_timer) to have the 2 towers shooting at a different pace.

    maybe you can work out with that.

    Yeah maybe I can work with that, will give it a try, thanks!

    But still I would like to see an example without the timer behaviour..

  • you might want to check the timer behavior for your towers rather than using the wait action.

    https://www.scirra.com/manual/167/timer

    I've made a quick exemple (I added a rotate effect with the rotate behavior just for fun) https://1drv.ms/u/s!AjkoCSebIn9Jiw8M5tPJp_4lOs7g

    Nah, that doesn't do the trick. Each tower needs to have a different timer, that's why the variable.

  • I'm trying to make an static tower. The tower has a timer variable so my idea is to wait tower.timer seconds and then shoot.

    I thought this was gonna be really easy but I'm getting problems. Either I get the tower shooting infinite bullets nonstop or just shotting the very first time without repeating the "wait loop".

    I was going for something like:

    For each tower > Wait tower.timer seconds > Spawn bullet. This has to happens only once while true, otherwise it will endlessly shoots bullets nonstop, but if I set once while true it will only do this once without repeating the timer countdown.

    Any help?

  • So if I set unbouded layout I end up with white margins at the edge of the screen. I don't know exactly how to fix this

  • If you are worried about management in the event to keep control of which is what. I did find out that if you can do a function here with a call back. If you name your room to a number or a name. (at this point id keep a journal to write down which room goes where.)

    Such as this place a variable on that invisible sprite label it to the room that you want to go to. Next create an event like this if player is overlapping the sprite have the action to be call function With parameter 0 to be the sprite's variable

    Next create a function go to layout by name (function.param(0))

    now you only have one event one function and one sprite to manage thousands of rooms (layout) transition.

    That's pretty much what I figured out to do. I just have one sprite and one code for everything BUT my question was if there was any way to avoid having one layout for each room (You mentioned the array I mentioned on metroidvanias but that's far too advanced for me).

  • Just have 1 invisible box. On collision go to 'next layout'.

    I do that in a way. I have one invisible box with a variable. The variable is the name of the layout, so I use go to invisiblebox.variable layout.

    Once again, that is not the problem. The problem is I will end up having way too many layouts, one for reach room. Like I said my problem is not layout switching, is keeping it efficient.

  • Yes you can use the save function aswell. You just have to set the instance variable (or animation frame <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">) of the object and then save the whole game state.

    If you use the save/load function you don't need to do that though, because it will save the whole state of the game.

    Here is an example capx with a working waypoint system:

    https://drive.google.com/file/d/0B7r2WY ... sp=sharing

    In my example you actually don't even need to use an instance variable. I just used the animation frame of the object (You can have an activated animation frame and a deactivated one). 0 is deactivated and 1 is activated.

    I hope this helps! <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    Thank a lot for the example. I heard pick nearest can cause performance issues, can I use a variable instead? I feel stupid. I figured out harder things and now simpler stuff confuses me lol

  • Smileh,

    I don't know if the UID of the object would work or not but I would add an instance variable to the checkpoint object. You can then give every checkpoint a unique ID (Value) which will be put inside the instance variable.

    When the player reaches a checkpoint, you can save the instance variable of that checkpoint in localstorage or simply with the built in save/load function.

    Then you just add a condition which checks every single checkpoint if it contains the saved value. If it's the same, that should be the last checkpoint and you can change its animation to active. Every other checkpoint can be set to the inactive animation.

    I hope this helps!

    Can I do this with the save/load function as well? I have no idea how to datastorage

  • Whats wrong with multiple layouts? What kind of problem you have?

    Just remember that you can set some layers as constans. For example hud. So you dont have to copy past them.

    Is not easy to organize the go to layout gates for each room, and I will end up having way too many rooms, which means way too many layouts. It's not really practical and I'm scared to run into some performance issues.

  • When making a sidescrolling game, all I can think of is everytime you leave the screen go to another layout. For a few levels that's alright but when you start to going further this becomes a nightmare.

    I've seen in the metroidvania gamekit from the scirra store a way to do this with 9patch and roomzones but that is way out of my league. I'm a total beginner and that's too advance for me.

    Are these the only two options?

Smileh's avatar

Smileh

Member since 22 Jul, 2015

None one is following Smileh yet!

Connect with Smileh

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies