Solomon's Forum Posts

  • Ok I got it working.

    For anyone that is interested, I created a variable:

    Keyboard_input_toggle = 1

    Nested all the keyboard controls in an IF Keyboard_input_toggle=1.

    Then when I wanted to disable keyboard for certain controls, just created and IF event (something happens) ---> Keyboard_input_toggle = 0

  • R0J0hound

    If that is the case how do I go comparing a value that has *dt to a value that doesn't have *dt?

    For example:

    If Speed>100*dt

    If the variable Speed does not have *dt this comparison will not work properly.

    I think Ill stick to the leaving the dt everywhere, at least for now. We shall see how it goes.

    Do you think this might have a big impact on memory, FPS and performance?

  • I know what you mean about being lost and sidetracked.

    I have been there so many times earlier, starting with game mechanics and then after a while focusing too much on game graphics, ending up mixed up and ditching a project all together.

    What I suggest is to take notes, on the progress regarding code. You can make bullet points and divide bigger objectives in smaller ones.

    Also I would focus on the core mechanics of the game first, put box place holders instead of proper sprites.

    As for the graphics, do some sketches beforehand, nothing really fancy, collect any inspiration that would suit your direction into a folder, and just look at it during quick breaks from coding.

    Once the core mechanics are down, then start to dabble with the graphics.

    As for sound, I would really focus on that at the very end, unless your game mechanic is a unique and different one.

    I find choosing sounds and music comes more naturally when I load up my game, play a sound in the background and just test play.

    Working on everything without a plan, can overwhelm a person. Perhaps you could make yourself a timetable, when to work on code and when to work on graphics or even sound.

    That being said and taking into consideration that different people have different workflows, this is just some info I gathered from my experience and I hope that answers your question at least somewhat.

  • Hi is it possible to disable keyboard input in an "IF" or an "OR" statement/event?

    I can't seem to figure this one out.

    I'm not using behaviors, so I would want to do this straight in the event sheet.

    Also is it possible to lock one key once the other key is pressed? For example if arrow down is being held, pressing arrow up simultaneously won't do anything.

    At the moment pressing 2 keys together messes up my values.

    Thanks a bunch as always!

    EDIT: Im starting to think its not possible to entirely disable someones input in order not to leave the user "hanging" and unable to do anything on their computer, including closing the game.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads

    I'm assuming that this game was created in Construct 2?

    If so, nice!

    Do you have a dev blog by any chance?

    Ps. Link didn't show up because of needed missing rep in your profile.

  • My RPG have 50 000 x 50 000 and i have 1600 sprites, PC can handle that

    Whew, nice to know!

  • One more question. Is it possible that Im getting a laggy movement because of all the "*dt" in the equations?

    I have an equation: speed1+speed2+(12*60)*dt

    Variable values: speed1 = 20*60*dt

    speed2 = 10*60*dt

    So in the end it turns out to be: (20*60*[dt])+(10*60*[dt])+(12*60)*[dt]

    (I put the dt in brackets for a clearer read).

    Now as you see I have a hell lot of "*dt", and I'm getting somewhat laggy movement, but I not sure if its my browser (as I was getting lags before, as I did post some earlier threads, but I don't mean to derail this thread).

    I'm going to have to test it on another computer I suppose to make sure.

    Whats your take on it? Am I using the dt correctly in this situation? Or should there be only 1 "dt" in the final equation?

    Thanks once again for the help.

  • R0J0hound

    Phew, it finally worked. Been messing with all sorts of values for the last 3.5 hours with breaks, but finally got some values that did it. At first I wasn't sure what was wrong, the problem being as it turned out I was entering values that were too small considering the*dt factor.

    Cant get used to it so far but I surely will with time. My values are all over the place unfortunately. Need to rework some events.

    So basically I am using the *dt values everywhere now, but isn't there a simpler way just to enter that once at the beginning, the dt conversion and then use it once?

    If its not simpler then no worries, this is good anyhow, just glad that the code is running so far!

    Thanks again!

  • I created a sprite sensor and have pinned it to an object, lets call it "Object A".

    While the sensor is overlapping with another sprite, I want the "Object A" to decelerate from its current motion into a full stop.

    At the moment it is abruptly stopping, and I cant seem to make good use of lerp.

    Is there anyway that I can decelerate to a full stop, or smoothly ease into a full stop, from its current speed? Any ideas?

    Is it possible to check the speed of a sprite without behaviors, only in event sheet?

    Thanks.

  • R0J0hound - thanks for the pointers, yep that works.

    For anyone who is interested more in this subject I am linking to the appropriate tutorial:

    https://www.scirra.com/tutorials/67/del ... dependence

  • Hi I was wondering if its alright to use the: Every tick| Set X to Self.X + 1, to mimic movement? Will it play smoothly when running (it seems smooth just wondering)? If not is there another way to use events to code manually the custom movement or bullet behaviors so that they play smoothly?

    I find the movement behavior quite limiting in what I am trying to achieve.

    Another question, how is it possible for me to speed up a movement without making it look stepped? I.E. I would like an item to move at a pace of 5 pixels per tick, so I used: Set X to Self.X + 5

    But now the movement is quite jittery. Is this where delta time comes in? I did some reading and will do some more, just making sure, thanks.

  • Ok great it worked without the custom movement behavior thanks!

  • Thanks for the response. Does that mean I need to get rid of the custom movement behaviour? And why every 0.5 seconds not every tick?

    Edit: Eh I read it again, yep I see spawning an item every 0.5 seconds in positon of X.

    The problem is that with the custom movement I managed to do so, but when I speed up the item speeds up when I slow down the item slows down.

    There is no difference if I add negative value it still doesnt change.

  • I have been thinking about this for about a week now. This actually made me take a brake from Construct but now I'm back at it again and still cant figure it out.

    I have a scrolling background, which is basically set that if I move around it scrolls along with the movement. I can go faster and slower. So the player sprite is standing still only the background is moving.

    Now I would like the randomly spawned items to move in relation to the background and to their position and still have their own movement. So if and sprite/item is moving let us say 10 pixels, when I scroll the background forward it moves less, and I can catch up to it, and when I move back it moves faster, as the combination of my speed is added to its speed. When I - the background is still, the item moves at its own speed only.

    I am getting nowhere with this, I know I have set the bar high for myself, any nudge in the right direction would be greatly appreciated by me.

    In using the custom movement behavior on the background as well as on the spawning sprites/items. I tried pinning them and then also giving them some speed but it doesn't seem that the 2 behaviors work together.

    Thanks.

  • Yes I see, but the idea is that it would be a top-down view of the ground only, just 1 long sprite. So basically you are saying that its better to solve this using tiles then eh?

    Ps. The background sprite would have no animation and be static only.

    EDIT: I was thinking of going with tiling background but that causes problems with scaling in Construct 2, in regards to some tutorials that I have followed.

    P.s. Thanks for the link, good read.