LittleStain's Recent Forum Activity

  • set angle : angle(x1,y1,x2,y2) where x1 is the x-position of point 1, etcetera..

    for the distance you can use distance(x1,y1,x2,y2)

  • Your second action is setting x instead of y..

    Also if you want to point the arrow at the point, you might want to put it's origin in the bottom left corner..

  • Easiest way it would seem would be to create a tiled-background consisting of a dark part and an empty part and set it's angle from point 1 to point 2 and it's width to the distance between them..

  • With bowed solid you mean 1 sprite, or is the bridge made of several sprites at angles?

  • LittleStain

    Just for your information (<--is this a valid sentence? Not a native speaker :/), firefox throws some script error, while chrome and NW.js works OK.

    BTW you guys stop doing awesome things and make the rest of us look like idiots

    Seems like Firefox has issues with webgl in this project..

    When turning webgl off it works in Firefox too..

    This might have to do with the canvas plugin..

  • Thanks newt

    Using the array-option was obviously the best way..

    Obviously the loop does give a pause, but I kinda like being able to do this:

    Canvas-Posterize

    Now let's see if I can use it for the backgrounds in my semi-retro-adventure-game-idea...

    If not, who cares..

    Loading The tilemap from Json

  • I'm having some issues to find the easiest way to loop through a grid, setting the tiles in a tilemap based on the rgb-values of a sprite pasted onto the canvas..

    At this time I use 32 values of gray.

    I use : (canvas.redAt(x,y)+canvas.greenAt(x,y)+canvas.blueAt(x,y))/3 to get the gray value between 0 and 255 and based on that set the tile at that position to one of the 32 tiles (going from black to white)..

    Although I think I am close to getting it to work the way I want to, I thought I might try here to get some input and pointers on ways to do it easier and/or quicker..

    There might be some very fun ways to use this, or just the tilemap exported as json, I actually don't know..

    Maybe it's just one of my crazy ideas..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • >

    > >

    > > You could just set "set angle" to "no" in the bullet properties..

    > > And instead of using set angle, set the angle of motion of the bullet..

    > >

    >

    No. because set angle of motion ask a degree. Wich i don't have. I have a target (object .X and Y) and thats all.

    Its a big hole in C2 i think, to at least not have a kind of "lengthdir" function in it...

    People could easily code their own tween movements with events if there was just that.

    or a simple option "move toward position" with a pixel per tick.

    But , you can still use a var to store the angle toward position, then reset angle of the object to 0.

    And use this var to set angle of motion.... it works, but OMG its complicated for such a small thingy.

    Anyway LiteTween is better i find than moveTo. Hope it'll be stable :s seems pretty heavy behavior

    Set angle of movement : angle(player.x,player.y,target.x,target.y) should work..

    Also setting a state to moving and while moving move 1 px at angle..

    It's all there..

  • Ok i see for the bullet example, but it rotates the sprite.

    You cannot set angle to position without rotating the sprite... so that doesn't do it for me.

    You could just set "set angle" to "no" in the bullet properties..

    And instead of using set angle, set the angle of motion of the bullet..

  • You could look at the move to example shipped with Construct2..

    It uses the bullet behaviour..

  • This is the "How do I" section of the forum..

    My intention was to explain to you how you can do it..

    If you can understand why the conditions of event 3 and event 11 can be true at the same time, you can change the conditions, to make sure this isn't the case anymore..

    Also it won't be hard to find other events that have the same issue..

    Seeing why events may conflict and knowing what to do to make only the event you want to execute actually executes will be of great help..

    As I suggested in a previous thread, one way to prevent two animations running at the same time, would be to add a condition "animation is not playing" to one of the events, in this case another way would be to add a "shift is not down" to your event 11..

    But this will not prevent the issue from arrising again unless you understand why this is nescessary..

    Also, depending on what you would like to add in the future one of those solutions might not fit your need..

  • Please explain what part of my answer to your question you don't understand!

LittleStain's avatar

LittleStain

Member since 26 Apr, 2011

Twitter
LittleStain has 4 followers

Trophy Case

  • 13-Year Club
  • Email Verified

Progress

14/44
How to earn trophies