LittleStain's Forum Posts

  • Actually it would be way better to have the player choose which of the two he/she wants to use, or even to choose his/her own keys..

    Then using keyboardkeycodes you wouldn't have the above issue anymore..

  • I'm not sure what you mean?

    Seems like you don't want the car behaviour, because cars don't behave like that..

    If you are talking like asteroid-type-spaceship-movement This tutorial might help..

    [edit] Glad you figured it out![/edit]

  • Add another condition to the "failed to find path" event?

    Maybe a boolean, set on a timer or a wait for signal?

  • That is what I have right now. All the blocks have "On Key Pressed W" or "On Key Pressed Up" simulate control Up (I have 8 way control on the player). But diagonal doesn't work. I made sure that 8-directional is enabled in the behavior too.

    As for the addition and subtraction I slightly edited that. Instead of using "Add" and "Subtract". I just use "Set" so I don't have to worry about the player pressing both button options at the same time.

    Here is how it looks now:

    This setup doesn't allow diagonal movement. If I tried to add a new block with a new number, it still doesn't work. I am guessing to allow diagonal movement I need either to use the default controls + unchanged 8-way behavior or mouse + WASD controls, right?

    Well if you change something, some things change..

    I had very specific reasons for using the adding and subtracting..

    Not using it the way I set it up makes the setup unusable..

    You'd just need events that don't contradict..

    if you have an event

    up is down

    and an event

    right is down

    and an event

    up is down 'and right' is down

    all three events are true when both up and right are down..

    So you'd need extra conditions to prevent them all from being true at the same time..

    The example I made was made to simplify that process..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you have the animations for that, it's possible..

    If the character is made out of parts (animated with spriter for example) this would make the eventing easier..

    It's all possible..

    Seeing that you are new here, it might be better to start with something easier to code, but like I said, it's possible..

  • I guess if you just want blood you could spawn it on an imagepoint of a hitbox that detects the collision..

  • > Would be nice to know what "Doesn't work" means..

    >

    it doesn't create the blocks grid.

    What does it do?

    Do blocks get created?

    How many?

    Where?

    Is the event sheet attached to the layout?

    Are the blocks set to visible?

    Is the animation speed set to 0?

  • Changing it to or blocks should work,

    on up pressed

    'or'

    on W pressed

    Problem is that than it would be possible to press both at the same time which would add the number twice..

    So probably creating a new event "on W pressed" with an extra condition "keyboard 'up' is not down" and adding W is not down to the on 'up' pressed would be nescessary..

  • You mean something like this?

    System create object at x = random(4,25) y = 200

    As you can see X is inside a random range and Y is constant..

    If you want to create the object after a certain time you could use a wait action in a triggered event or use timer behaviour for it..

  • I don't know about that, my game is still really slow.

    If you want to check out the .capx see my forum post here: https://www.scirra.com/forum/viewtopic.php?f=180&t=167483&p=1009072#p1009072

    You don't know about what?

    Could it be the game is slow, because you have thousands of objects?

    I can't open your capx, because it uses the third party plugin noisejs, which I don't have or need..

  • If you name the animations correctly it works..

    For example there is no animation called "Down", it's called "Front"

    Also Construct2 read events top to bottom, so if you want to use the "right" and animation for up-right and "down-right" you should put those events at the bottom or add conditions to the above event..

    Setting the animation to play from current frame might be needed if you choose the first option..

    The big difference between my example and what you do is I don't use "key is down", but "on key pressed" just adding and subtracting, so the diagonals are immediatly considered and that's why I don't need to add as many conditions..

  • >

    > Ok..

    > I'm sorry, but I don't understand why that would be important..

    >

    > But if you really, really have to, you could do it by using bullet behaviour for the movement and only use the pathfinding behaviour for the pathfinding..

    >

    > Like in this example:

    >

    > Pathfinding in circles

    >

    Ah, well - I guess there's no logical explanation to why I want it, other than wanting to make rotation and movement look seamless. Was hoping it was possible to constrain angles.

    Like I said, it is possible, when using the bullet-behaviour for the movement..

    Just setting the angle of movement of the bullet to round(bullet.movingangle/5) while moving should do it..

  • I guess the problem here is the position x and y of your effect..

    Seems like they are based on screen(window)-coordinates, rather than project coordinates..

    So to scale the effect you should move those coordinates..

    Not sure what you want though..

    If it's the middle of the screent, it would be simply windowwidth/2, windowheight/2

    If you look at the preview of the effect provided in the thread and scale the window (browser) manually, youll see the same issue..

  • > Pin position only and set the sprite-rotation through event/action?

    >

    > So something like:

    >

    > System every tick

    > > sprite set angle : round(pathfinder.angle/5)*5

    > > sprite set frame: round(pathfinder.angle/5)

    >

    > Should work if 0 degrees is frame 0, 90 degrees is frame 18 etcetera..

    >

    I have pinned position only, but like I said, it's not the sprite object that is the issue. Ignore the tank sprite, it's the green box I've got an issue with. The pathfinding object is a Construct 2 object square filled with green color, practically a "vector". When I right-click on a place, it will rotate towards the point and move, and additionally rotate on its way. The angle can be changed as low as 0.0000000000000000001 degrees, but I want it to rotate 360 degrees but snaps to 5 degrees per rotation. In other words, it can only rotate in 72 directions, rather than the 1 million tiny pixels it can rotate to.

    Pay attention to the number here:

    That is the angle of the green square. Don't mind the tank sprite, I know how to fix that. What I need, is that green square to snap the rotation, so it doesn't land on something like 83.546654896046809 degrees, but snaps on 80 or 85 (like the tank sprite does - but again, ignore the tank sprite).

    Ok..

    I'm sorry, but I don't understand why that would be important..

    But if you really, really have to, you could do it by using bullet behaviour for the movement and only use the pathfinding behaviour for the pathfinding..

    Like in this example:

    Pathfinding in circles

  • Just looked at a video for kirby wing:

    Subscribe to Construct videos now

    A combination of animation, rotate and bullet should do the trick..