Yann's Forum Posts

  • As Mipey said.. But it's quite a bit more complicated if you also used force to make the object move.

    You'll have to add vectors (:

  • send the capx

  • Wronghands

    If you use the mouse, you pretty much have no choice but to use a pathfinder.

    A pathfinder will return all the cell you have to go through to reach the cell you clicked on (if it is reachable).

    Then, the grid movement I coded won't be used at all. You won't need to check for collision and you will just have to interpolate between each coordinate returned by the pathfinder.

  • You have to wait for real pixelshader hardware accelerated fx, my thing can't work in real time the process is too heavy

  • makes me think of what I did on another capx

    verticalMovingPlatforms.capx

  • GingerBatMan

    Not at all... Just saying :D

    A string is a string there's no spacial treatment if a string as some coma or not.

  • not useable in a game but it was fun to do

    http://dl.dropbox.com/u/23551572/C2-Gam ... index.html

    fear the capx <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    lighting.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just keep the dt, it's not only a framerate thingy, it makes the movement smooth and consistant. And the substraction is what makes the movement pixel precise. It's not a fix it's just manual rounding. So I strongly suggest you keep it that way. One tiny action is not what we can call "a hassle" in my opinion.

    Also, for the angle, I already thought about that. I could have simply used an instance variable. But it's just a sprite. It's just an object with angle and position. Nobody said you had to use the same object for graphically eye-candy stuff.

    Just set the 'Player' sprite to invisible, and just make your character follow the position (and not the angle) of this 'Player' sprite.

    And for the bug you talked about, I would guess that it's a type issue. booleans aren't string nor number. What is displayed in text should be strings or number converted into strings. C2 might not handle what is called type casting from boolean to string.

  • I don't know if you noticed but the 'log' variable... is in CSV (Coma Separated Value)... Just saying :D

  • GingerBatMan

    Also you can add

    System: iterator = tokenCount(log,newline)-1
      -> System: set Replay to 0
      -> System: set iterator to 0

    nested under event 2 just after event 3

  • You can't name instance variable as X and Y 'cause it would conflict with the inbuilt .X and .Y for position.

    Also in your solution you suggest to spawn a lot of objects to work as a path remainder (breadcrumb). But it's too heavy to create a whole object when you just want to store 3 values (X,Y and Angle).

  • Well I already did that in construct classic to test the Stack,Queue,Deque plugins. So it's not much of a challenge. Also I never used webstorage.

    I'm not really sure how (in a design sens) I would use it. You know, webstorage seems like storage that can be wiped out anytime, so I don't know how to design something with that level of reliability

    Should it only just be for temporary stuff? Is a replay a temporary stuff? If it's just temporary why not storing it in a global variable?

    So to design a permanent save system, I'm not really sure webstorage is a good tool.

    Anyway, logging x,y,angle and rotation could be done really easily by :

    Global Variable log = ""  // each lines is a string formatted as "X,Y,Angle"
    Global Variable replay = 0  // is on replay mode?
    Global Variable iterator = 0  // position of in the log during replay
    System: replay = 0
      -> System: set log to log&Sprite.X&","&Sprite.Y&","&Sprite.Angle&newline
    System: replay = 1
      Local Variable state="" //current state "X,Y,Angle"
      -> System: set state to tokenat(log,iterator,newline)
      -> Sprite: set X to tokenat(state,0,",")
      -> Sprite: set Y to tokenat(state,1,",")
      -> Sprite: set Angle to tokenat(state,2,",")
      -> System: add 1 to iterator

    That should work.

  • siron

    Oh a lost Construct Classic user :D welcome \o

    Yeah colors are vector type variables (which means they have components)

    Its a bit like position, if you want to store a position you need two variables (X and Y components)

    So if you want to store a color you need 3 (Red,Green and Blue or Hue,Saturation,Brightness) maybe 4 if you add Alpha (: