haopl's Forum Posts

  • I understand, this is not an online game?

    If not, then:

    1. create a sprite, an "eye", not Visible.

    2. add a behaviour "SCROLL TO" to the "eye" (not to the character).

    3. EVERY TICK: position the "eye, like this:

    X = player1.X + player2.X / 2

    Y = player1.Y + player2.Y / 2

    It will always center the camera between both players evenly.

  • Maverick1912: It would be a good tip...

    If HERO is ON COLLISION with 1PX-BRICK:

    --- HERO.Positiox.X-1

    (or on any other element collision/tip of gun). The animation is nice and smooth, no glitches.

    Unfortunately, this will not work, until there is no pixel-bricks on the floor at all.

    And I need a character to be able to walk on some lefted over 1pxBricks.

    And also, in my case, the hand with a gun is a seperate spirite, that rotates, so this solution will not work corectly:

    imgur.com/a/HXFQxQd

    (don't mind shooting through the wall, it's just an early stage of this project, it needs to be fixed obviously)

    -----------------------------------------------

    PROBLEM SOLVED.

    The collision polygon was not exact quare. It was skewed 1 pixel. I don't remember, which angled side coused that behaviour, but the lesson is that: always make sure your collision polygon is a perfect rectangle or square.

  • Laura_D: You are right, sorry about that :-)

  • Absolutely :-)

    animated:

    imgur.com/a/XOcj2gj

    still screenshot:

    imgur.com/a/42qBAfz

  • In my retro, pixel art game, I have created a wall, lets say 8x100px, made of 800 1-pixel blocks, placed next to each other.

    The idea was to let the player destroy the wall pixel by pixel.

    But there is a strange behaviour:

    The player can literraly climb on that wall, like spiderman, because a player can walk onto 1px higher stage.

    But, in my opinion, when the plyer climbs on first bottom pixel, should be stopped, because there is no space for him to walk foreward.

    I hope I made myself clear.

    Does anyone struggled with similar issue, and if so, did anyone find some solution?

  • Ok thanks.

  • I would like to edit poligon points, lets say, something like:

    Character is walking - polygon points A

    Character is crawling - polygon points B

    I could make two different animations for a sprite, but I have really a lot of different animations, and this solution will be a huge pain in the ass.

    Or maybe there is another, cunning way to achieve the same effect?

  • I will use the post to add mine question:

    Is there any way in construct to create independedn't canvases with existing behavours for each one (bullet, 8-way etc...)?

    Right now what I am doing is based strictly on math (tilemap based on arrays, and displaying only part of it, with a thick black separator, that hides a row of tiles, before they are fully displayed). But I don't think there is any other way... am I wrong?

  • Sure thanks

    I am building a beat'em up game.

    I want to put all "enemy" characters into one sprite, where number represents an enemy type animation (1-monster, 2-zombie, 3-soldier), like this:

    1_moving

    2_moving

    3_moving

    1_standing

    2_standing

    3_standing

    1_was_killed

    2_was_killed .... etc.

    When "on start of layout" I want to put random sprites on the stage, I make a random number to each instance of an enemy (called "character_type"), and then based on that, I want to use animation based triggers, to do something with the sprite, for example:

    "enemy" On animation "was_killed" finished => do some explosion, or whatever...

    Now, I should be able to have it rather like that:

    "enemy" On animation self.type & "_was_killed" finished => do some explosion, or whatever...

    Why do I do that in a such a twisted way: because that way I can define all behaviours for one sprite. Otherwise, if I create 20 different enemy types I will have to have 20 different actions/interactions defined. And if I have to alter something in their code, I will have to update 20 sprites, not just one.

    I hope it makes sense what I am typing

    Thanks a lot again!

  • Hello.

    Each of instance has an instance variable called "animation_number".

    I need to get acces to this variable through expression, similar to:

    sprite.animation_number (certainly not with a dot...)

    Is there any way to acces this instance variable that way?

    Like... sprite.variable(animation_number) or anyway??

    Thanks a lot for any advise.

  • Great answer! Thank you so much. I didn't try it yet, but I see the logic here, which will solve my issue 100% !!!

    Thank you a lot!

  • Hi.

    I have a character, that uses two buttons: one for a PUNCH, another for a KICK. For those events I use "on PRESS".

    Is there any way to trigger pressing PUNCH & KICK at the same time, but not by "ON KEY DOWN" (Key down works differently then press. DOWN triggers the event continuosly, while PRESS triggers is only once /similar to DOWN and immediately RELEASE/).

    I wish to emulate something like:

    -> On key pressed O

    -> On key pressed P

    not like this:

    -> on O down

    -> on P down

    I know that I can't really do the first, because its triggers, and it looks like I can use only one trigger at a time.

    The problem that occures with me is that:

    When I press DOWN the O+P keys, first an event under O starts and then/after, the right O+P event.

    It looks like my character, after pressing O+P, first punch (O), and then do super-move (O+P).

    I also don't want to use ON DOWN for punching/kicking, other wise the player can just hold the button and punching will be run continuosly until player releases it.

    Any help will be appreciated.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Aher0: image point will not work because after turning 90 degree, the pixel will not be drawned at the cara path anymore. it will appear "after the car". the pixel will turn 90 with car at the same time. i hope i explained it clearly.

    shinkan: what about the situation when someone turns 90 very quickly twice and the car basically turns

    180? and also cars sprite and pixel (it is actually a sprite - square of width/height as car's width) after turning they touches eachother with the its corners. So the pixel/wall should appear about few pixels after the car...

  • Ok i figured it out.

    I had both: "click on object" and "touch tap" event on sprite. I didnt realise, that "touch tap" also works with mouse left click. And that was giving me the "double click" through layouts. I just removed the "click on object" and its fine now.

  • Here is my problem:

    The car is going and it is leaving a pixel behind. Each pixel appears in the middle of the car (central Image point). And if the car hits the pixel (the wall), it explodes.

    I think the concept is clear. But... the car will explode at the start of layout, because it creates a pixel just at its position.

    So... how to do it elegantly, so the pixel has Collision ON, but after it does not overlaps the car anymore?

    I tried with counters, like "Afters a car moves 30 pixels away from pixel, eneble pixel collision" for each pixel. But this solution is very heavy, especially after many hundrets of pixels appear.

    Any "elegant" solution?

    Thanks