DoobieDoctor5000's Recent Forum Activity

  • I'm having a few issues getting an animation to work properly. I want to achieve the effect of a door opening and closing. At first, I tried doing it with an animation within a single sprite, but given the openDoor sprite needs to be larger than the closedDoor sprite, I decided to instead use completely different sprites.

         I'm using the following events:

    • Mouse ---> On Left Click on closedDoor ---> closedDoor ---> Destroy

         AND                               ---> System ---> Create openDoor 330,413

    • Mouse ---> On Left Click on openDoor ---> openDoor ---> Destroy

         AND                               ---> System ---> Create closedDoor 315,429

    With these events, the closed door will initially destroy and spawn the open door upon clicking on it, but the open door will NOT destroy NOR spawn the closed door upon clicking on it.

    I'm at work right now so I can't upload the capx, but if need be I will upload it tonight after work.

    Thanks you!

  • I'm having an issue with Construct 2 on Steam. In order to stay up to date, I have to opt in for beta updates. Thing is, whenever I'm in offline mode (at work or at home), Steam doesn't remember my beta opt-in, and I have to re-opt in and re-download the update. This could be seen as a mere annoyance, but at home I have no internet, making it impossible for me to open the capx files I've created, and at work, the wifi is horrendously slow. What would take me 4 seconds at my girlfriend's house will take me an indeterminate amount of time at work.

    Is there a way for me to set the opt-in with Steam and make sure that it remembers and keeps the update? What am I doing wrong?

  • I'm using the array as a en.wikipedia.org/wiki/Queue_%28abstract_data_type%29

    The second part is what angle is used, which is the oldest value in the queue or the "back" value. The gist of this is we are effectively using the direction that was pressed four frames ago.

    f sprite is not moving ---> set animation to first sprite in animation, and then reset/empty the arrayWhen the sprite is not moving we want the animation to reflect this. Without this event the sprite would just walk in place. By setting the animation frame to 0 we prevent animation and use the image for standing. The effect of resetting the queue to be empty is not really noticeable and that action could be removed. I just thought it logical to fill the queue new every time instead of reusing existing values from a previous motion. But considering the time it takes to fill the array: 4 frames *dt ~= 0.07 seconds it's pointless as that's faster than human reaction time.

    And yeah that's the main character from Earthbound.

    Thanks yet again. That's a lot of information and I'm going to take a little time off of studying it for tonight. I get the queue idea, and how its first-in first-out (took me a while to get it). I'm having trouble grasping the formula, though. I don't have a lot of experience using modulus, so it doesn't come as second nature to me. I will be back on it tomorrow though.

    In the meantime, I attempted to make a demo by basically plagiarizing what you did, and I STILL didn't get it right! lol You can see by downloading my capx here: doobiedoctor5000.allalla.com/my8dirattempt/my8dirattempt.capx

    Movement works just fine, as does diagonal placement, but you can see how it's just NOT working how its supposed to lol. It's frustrating but I WILL get it!

  • It does that since it's hard to release two arrow keys on the same frame.

    One possible solution would be to use the angle from a few frames back. The idea being that it's easier to release two arrow keys over a few frames than one.

    http://dl.dropbox.com/u/5426011/examples17/8dir2.capx

    Thanks for showing me a working example. Is that the main character from Earthbound? :)

    I don't exactly understand everything you did, though. I see you used an array, which I have yet to fully understand/utilize. I will list my interpretation of what you did here. Please let me know where I'm going wrong:

    • Create global number variables joyx and joyy
    • System --> Every Tick --> set both global variables to 0
    • Up, Down, Left, Right Arrow Keys --> is down --> add/subtract 1 to each global variable in accordance with direction (+1 for down/right, -1 for Up/left)
    • if either global variable is not equal to 0 --> add the angle expression to the array
    • If the array has 5 or more entries on the x axis (width) --> move to the back of the array
    • if sprite is moving in any direction ---> set animation to walk & int(add 360 to the back of the array, divide it by 360, and divide the remainder by 45) from current frame
    • if sprite is not moving ---> set animation to first sprite in animation, and then reset/empty the array

    As you can see, I can understand a little bit of it, but I'm missing the meat of it.

  • Thanks again! <img src="smileys/smiley1.gif" border="0" align="middle" />

    Unfortunately it only works here and there. Most of the time the player only faces directly on the x or y axis, and never diagonally. Sometimes it works as intended, where when you release the arrow keys it stays facing diagonally. I'm not sure why it doesn't work all the time.

  • Disable the "set angle" setting of the behavior. Then do the following to set the angle based on what directions were pressed last.

    global number joyx=0

    global number joyy=0

    every tick

    --- set joyx to 0

    --- set joyy to 0

    key up is down

    --- subtract 1 from joyy

    key down is down

    --- add 1 to joyy

    key right is down

    --- add 1 to joyx

    key left is down

    --- subtract 1 from joyx

    joyx not equal to 0

    or

    joyy not equal to 0

    --- set player angle to angle(0,0,joyx,joyy)

    Thanks for the reply! I was able to do everything down to a T, up until the last part where you set the angle. I keep getting a syntax error when I try to set the player angle to (0,0,gvar_checkAngleX,gvar_checkAngleY) (I used my own variable names). It has a problem with the first comma, saying that there should be something else before it?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can see my game here: doobiedoctor5000.allalla.com/shootTheMonsters/index.html

    Controls: Arrow keys to move, space to shoot

    My current issue is I don't know why I can't get the player sprite to face diagonally without actually moving diagonally. If I release the buttons, it will either face along the x or y axis, but not both at the same time. I'm using the 8Direction behavior for the player. How do I get it so the player remains facing diagonally after the arrow keys are released?

DoobieDoctor5000's avatar

DoobieDoctor5000

Member since 18 Mar, 2013

None one is following DoobieDoctor5000 yet!

Connect with DoobieDoctor5000

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies