rekjl's Recent Forum Activity

  • Ok give me a few minutes, I will set up a simple capx for you to learn and understand.

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

    Ok the link is above. It is a simple capx and commented so you can study it to understand how it works than you will be able to easily apply it to your own game. In the capx, you can also copy and drag more Sprite around, it will still work the same no matter how many you have because we are using UIDs to select each individual sprites. Have fun!

  • Actually it does automatically continue to play the music when you go to another layout. Few things you might want to have a look at.

    Is your music in the proper music folder? Also you mention "autoplay resource from file(loop)", I don't know what action this is cause I can't find it at all. Are you using the Audio Object? All you need to do is use the "Play" action and select loop. As long as your other layouts do not issue the Audio object any new actions, it will continue to play the music.

  • I am pretty sure that unless you ask your music to stop, it will continue to play even when changing layouts. If you just want your music to continuously play throughout the game, you don't really need to use globals. Only use them when you want the music to stop, mute, or switch music tracks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am not too sure if I understand correctly, but you can fix all of them using variables.

    But the first thing you will need to fix is the second part of your question. To make sure only that one tower is upgraded, use a variable to record that tower's UID. In case you don't know, UID is like a number tag given to every single sprite in the game. Also, add a simple sprite into your layout, just a small one and you can set it to invisible as well, I will explain why we want it later, but for now, let's call it SpriteInvisible. So what you can do is this:

    On left button clicked on DialShooter --> Set Variable1 to DialShooter.UID. And also Set SpriteInvisible position to DialShooter's x and y coordinates.

    Than when the player clicks on the upgrade button, create a sub event and select the DialShooter by UID, using Variable1 as a reference. That will take care of your second issue.

    For the first one, you need to remember that the sub events will all run as the conditions have been met, so it will always return to default after 2 seconds. What you want to do is do a check to see if it has been upgraded or not. If not, than only return the animation to default.

    Again you can do this using variables. And for this case, I won't use the Wait action, I would rather create my own custom timer cause I think it will work better. What I would do is this, create 2 global variables, one called CheckTime, another called CountDown. And another local variable for the DialShooter, called ReturnDefault. Now on for your first event, just add the three actions and remove the rest. Set CountDown to 120, CheckTime to 1, and ReturnDefault to 1.

    Create a new event and set three conditions, check if CheckTime = 1, CountDown > 0, and add the every tick condition together. In the subevent, use the deduct variable to deduct Countdown by 1 (because in the every tick condition, 60 ticks equal 1 second, so 120 ticks equal 2 seconds. So once your Countdown reaches 0, that means the 2 seconds are up. Create an event below with two conditions, if CheckTime = 1 and CountDown =< 0, add the action set CheckTime = 0 and select the DialShooter with the UID variable, and return it's animation to default. And as you can see, if the player clicks on another DialShooter, the CountDown is reset to 120 again from the event above.

    Lastly, you still have your local variable ReturnDefault which is at 1. The reason we want this is because, if you select another DialShooter halfway while it is counting down, the events only work on the new DialShooter, and the first one you selected will never return to default animation. Remember the SpriteInvisible we used earlier, this is where it will come in handy. Create a new event below, with two conditions. If ReturnDefault = 1, and if DialShooter is NOT overlapping with SpriteInvisible, set it's animation to default and also set the ReturnDefault back to 0. Remember to set ReturnDefault back to 0 for the event when you upgrade as well.

    I'm sure there must be a more effective way, but this should work for you.

  • I just tried implementing localstorage into my game, and I found an issue that I would like to hear anyone's opinion on.

    I am using an array to store which levels have been cleared, and which is still locked because the previous levels haven't been cleared. The problem I am having is that previously, I would load the array and set each button's animation frame to display the appropriate frame as a sub event to the on start of layout event. This ensured that everything was set up immediately at the start, and the player will not notice it.

    But since LocalStorage can only be used as an event and not sub event, I placed the button animation frame loading events as a sub event for the On item get event, since I thought it made the most sense to put it there and have it load immediately once the value has been retrieved, and also to ensure it only loads once. But the problem is that loading the LocalStorage takes a small but noticeable amount of time. When loading the page, you will notice the button frames changing from default animation frame to the loaded one.

    I was curious what others are doing to counter this loading time to ensure that it isn't noticeable for the player? Is the only option to use an earlier page to load all the values than when you go to the next page, do not reset all global variables but use the earlier loaded variables so you can add it as a sub event to the on start of layout event? Or is there another way to get it to load much faster?

  • It's hard to say what is wrong without looking at the code. Can you share a capx or upload in image of that bullet part of the code so we can have a look?

  • At first I thought it sounded very much like a manual, but when you mentioned 3rd party plugins and wrappers, I think this would be great! Most plugins and wrappers are not easy to understand for the beginners. And if it is like wiki in that other people can contribute, people might even be able to share their performance stats regarding those plugins and wrappers. Especially likes the fact that everything will be on 1 page or area which makes it easy to find and study.

  • If you are simulating a shotgun spread fire, you don't need multiple image points. Just give the bullet a "bullet" behavior, than on created, adjust some of their angles to give the spread out formation. You could use the "random" code to give it slight variations.

  • paulscottrobson, sorry I guess I really didn't explain that too well. I was wondering if it is possible for me to keep the tilemap at a certain size, but have what is being displayed in the tilemap, animated to make it appear like it is moving from left to right. In other words, the tilemap will continuously loop what is being displayed, while maintaining its size. Almost like a tv screen showing moving images.

    I am guessing that this is not possible.

  • paulscottrobson, thanks but that would be actually defeating the purpose of using tilemap. I am building for a mobile game, so I am trying to be as conservative as possible. Constantly creating lots of sprites will take its toll on any mobile device. I have already created a system where I animate a large tilemap, and constantly create a new one once it almost runs out of space. It is much more effective this way than using sprites, but would still like to know if there was a way to actually tell the tilemap to "move" the sprite design used for the tilemap in a loop style.

  • I am not sure if this is even possible, but wanted to ask if anyone knows. Let's say I have a simple design on my tilemap. I want to animate the design to move from left to right. Is it possible to tell the tilemap to move the sprite used in the tilemap in a loop style from left to right, or is the only option to recreate new tilemaps at the end of the previous tilemap?

  • I've never gone beyond 720 because I think for my case, it wasn't necessary at all. I am using vector style graphics, and in all honesty the visible difference is quite small from 720 to 1280. If you are using painting style or art with lots of fine details, the difference will be much more obvious. So depending on your art style and impression your want the player to feel, you'll need to decide on whether the cost of higher graphics vs performance will provide the most enjoyable gaming experience for your player.

rekjl's avatar

rekjl

Member since 13 Oct, 2013

None one is following rekjl yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies