superpowerjoe's Forum Posts

  • resurrecting the dead for justice

  • Great! i think that works perfect, thanks!

    what i dont understand however is, once spawned how is the bullet object moving forward. as for everything else i think i get it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So I have a "cannon", that shoots a laser-like ray, so instead of shooting various "bullets" it shoots only one long ray.

    The "cannon" spins on its own axis. And and the ray rotates along with it, like the dials of a clock.

    Now, i have some wall-like obstacles, that i want to obstruct the path of the ray.

    Is there any way to do this? so that when the ray rotates on the axis of the cannon, make it not go past (in terms of radius) once it hits a wall, in the same manner that when light hits an opaque object it doesnt move through it and you have a shadow on the other side.

    OR instead, how would this be done: ray is object A, and wall is object B, whenever B overlays A, intersect A's collision mask, so that the part occupied by B isnt accounted for?

    hope any of this made sense.

  • When organizing events and event sheets, i tend to have each layout just include individual sheets, and create for example one for input, movement, collision, animations, etc

    and then when the layout starts just have it load whichever sheets needed,

    so each sheet affects every layout that uses it, and you only have to edit that one sheet. within sheets and layouts it's good to organize with colored comments and groups. - i dont know if that was the kind of tips you were looking for.

    as for collision, i personally have some nuances with it, but i use the sprite.left/right/top/bottom/x/y expressions instead of sensor srites, in order to detect it.

    hope some of that helps

  • It will not collide perfectly because your sprite will move more than 1 pixel per frame, ex. if your sprite is 1 pixel from the object to collide and your FPS is 60 than, 120*1/60 = 2 pixels, it will move 1 pixel inside the collision object, with lower FPS is even wrost try to put it fixed aroud 15 fps and test, try it on unlimited too and you will see it work perfectly because it will move lower than 1 pixel per frame.

    The way i discribed, using loops, will always move the exact pixels before collide with the object.

    The "is moving" i mean to be your way to detect this, in your case you have to do "On keyboard: Left button is down", move to left, and so on...

    Hehehe, i thought so, i felt dumb thinking there was an "is moving" event that i'd skipped over! anyways that question HAD to be asked <img src="smileys/smiley36.gif" border="0" align="middle" />

    anyways, are either fixed or unlimited FPS recommended? i thought v-sync was optimal.

    I had tried it on unlimited, and collision-wise it worked great, but i had that sprite tearing almost, that i reference before, like for example, if the sprite is 32x32, it'll show up as that size, but within its own 32x32 bounding box, it'd be moved say to the right, and the left border would be drawn into the X0 and X1 columns, weird.

    and i thought fixed FPS was supposed to hinder your TimeDelta

    i'm looking forward to implementing a loop as you suggested, it looks like i'll have to clean up the game structure first, in order to replace it neatly hahahaha <img src="smileys/smiley4.gif" border="0" align="middle" />

    as for now, while i'm restructuring it, i got around the collision enough to work with it with something like this:

    B pick closest to A.left\right\top\bottom

    + if A.left\right\top\bottom >\< B.left\right\top\bottom -\+ speed*TimeDelta

    -> then move at speed*TimeDelta

    etc

    extremely summarized but in essence that's what i got around to enough for it to work until applying loops, if it helps anyone in the future.

    XD

  • I really can't understand what you intended to do with this:

    In these conditions you set the Sprite object to move equally to right, left,top and down. Of course nothing will happen...

    lol, i know, it's meant to represent individual movement on key presses,

    i just skipped over the key press events when posting it.

    the reasoning was something like:

    • if key down

    + sprite is not overlapping object

    -> move in given direction

    however there's going to be a moment, where it isnt overlapping, but will move once more, and end up overlapping,

    so i tried with an offset, but still sometimes stop before colliding, and at random occasions really, against the same wall it may or may not collide perfectly XD

    For the collision problem you have to use "For Loop" and make like this:

    Sprite is moving

    >    + For 0 to ceil(120*TimeDelta)-1

    >       + If Sprite is moving right

    >         + [negated]Sprite is overlapping at offset ((ceil(120*TimeDelta)-LoopIndex),0)

    >           -> Sprite move (120*TimeDelta)-LoopIndex at 0 Degrees

    >           -> Break

    >       + If Sprite is moving top

    >         + [negated]Sprite is overlapping at offset (0,((ceil(120*TimeDelta)-LoopIndex)*-1))

    >           -> Sprite move (120*TimeDelta)-LoopIndex at 270 Degrees

    >           -> Break

    >       + If Sprite is moving Down

    >         ....

    >       + If Sprite is moving Left

    >         ....

    >        

    Do it to the four sides.

    To make conditions for diagonal angles is a bit more complex.

    cool, i'll try it out, however i do not see any "is moving" events,

    thanks.

  • ok, seriously, can someone please

    <img src="http://dl.dropbox.com/u/45834687/funny-3aa982af7b0b1d181cc2c75e1306ecea_h%5B1%5D.jpg" border="0" />

    how come

    + Sprite: [negated] Sprite: overlaps obj : offset (0,0)

    -> Sprite: Set X to Sprite.x - (120 * TimeDelta)

    + Sprite: [negated] Sprite: overlaps obj : offset (0,0)

    -> Sprite: Set X to Sprite.x + (120 * TimeDelta)

    + Sprite: [negated] Sprite: overlaps obj : offset (0,0)

    -> Sprite: Set Y to Sprite.y - (120 * TimeDelta)

    + Sprite: [negated] Sprite: overlaps obj : offset (0,0)

    -> Sprite: Set Y to Sprite.y + (120 * TimeDelta)

    does NOT work as intended?

  • ok, seriously, someone help me, couse i'm either missing something or construct is doing something wrong XD

    no matter what i try, i always get like one offset to the left, and one to the bottom,

    like it would look like this

       0

    1     0

       1

    i'm going nuts here

  • Thanks Tulamide, i did try that, but the same happened nevertheless.

    I tried adding +1/-1 offsets to see if it fixed it, but it went from about 2px overlap without the offset, to it stopping 1px before collision with the offset,

    the only one i got to work fine was this one:

    + System: Sprite2.Left Lower or equal Sprite.Right +1

    but without the offset, it sometimes overlaps, and sometimes works pefect.

    i'm leaning towards the thought that i'm missing some delta time element,

    i've included dt in movement which basically goes like this:

    if key down > set x = self.x + 120 + timedelta

    how could i include delta in the coll detect?

    i've tried every ticks, but didnt change anything

  • here it is, pretty much what i posted earlier. dropbox

    anyways, i want to be able to do it via events.

    i'm thinking that the problem might be that i'm checking for collision, instead of non-collision

  • Thanks! It worked. And you're right, changing the password from within my account does indeed break it again.

    Perhaps it would be helpful for others to sticky this issue.

  • So i'm using an event with a loop to carry out the jump, and it's working out fine, if the key is released the "player" drops to the ground, and all.

    but the part i cannot get right, is making a loop or whatever event for a jump sustain max in order to kill it. i've tried with timer, with count, and with start and max variables.

    obviously i'm doing something wrong and at a loss here.

    basically my stripped down jump loop looks like this (without the particular collision, jump state and gravity checks.):

    + on Key down

         + For "Jump" 0 to 64

              -> set Y to .Y - (256 * (TimeDelta / 64))

    64 is something like my accuracy number

    so what would be the loop to kill the jump, if say i only one the jump to last half a second and then have the player fall?

    my reasoning was to have something more or less like this:

    + on Key down

         -> set global('Jump_timer') = Timer + 500

         + For "Jump" 0 to 64

              + if global('Jump_enable') = 1

              + if global('Jump_timer') =/< Timer

                  ?-> set global('Jump_enable') = 0

              + if global('Jump_enable') = 1

              + if global('Jump_timer') =/> Timer

                  ?-> set Y to .Y - (256 * (TimeDelta / 64))

    but i couldnt get it working,

    help anyone?

    <img src="smileys/smiley4.gif" border="0" align="middle" />

  • You do not have permission to view this post

  • Did you find the solution here or figured it yourself? It'd be nice to know how it works out. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • hey, i'm kinda interested. at least just being curious, but i'm not able to pm you. =(