RandomDood's Forum Posts

  • If I moved the player in the opposite direction by the amount measured, wont that just cancel them both out and then the end result would be 0 (meaning there would be nothing to measure or moving because nothing is changing)?

  • I feel kind of stupid asking this question, but how do you do this:

    newgrounds.com/portal/view/571844

    More specifically, how do you make it so the main character stays on the screen while everything else moves down or up or sideways AND without changing the layout size?

    I tried using the platform behavior, but ever time my character bounces off an object, he get higher and higher until he leaves the screen.

    I know in order to make it infinite you wouldn't want to change the layout size, but instead spawn enemies, obstetrical and items outside the layout and have them move in.

    OR am I just thinking about this too hard?

  • Thanks. I got it to work using the LOS behavior.

    +If "Baddie" has LOS on TempX, TempY

    -->blank

    +else

    -->System: Create "Baddie" at TempX, TempY

    For some reason it doesn't work with the condition inverted.

  • +Every 100 ticks

    --> global variable 'TempX' = random (playfeild.width)

        global variable 'TempY' = random (playfeild.height)

    ++System: (inverted) /= "Baddie" at TempX+cos(360)*distance, TempY+sin(360)*distance

    --->System: create "Baddie" at TempX,TempY

    I think this is right, but I am still getting overlap.

    I think its because of the angle being 360. Maybe its only checking that one angle at the distance chosen relative to "Baddie" instead of the entire radius.

    Would I need to do a loop that checks the object 360 degrees around? That would be completely inefficient though. That 360 checks * the number of objects. <img src="smileys/smiley5.gif" border="0" align="middle" />

    Do I also need a for each "baddie"?

  • Thank you for the reply.

    This isn't exactly what I am looking for however(although extremely useful), and that is my fault for not explaining properly

    If I were to use your image as an example, I am trying to spawn "Baddie" within and around the "radius"(within the playfield or where ever). Spawning them at distance "x" relative to EACH individual "baddie" rather than all of the objects as a whole or group.

    I don't know, may something like:

    +If random(XY) of playfield is not overlapping "baddie".XY + global(radius/distance)

    --> Spawn "baddie" at position XY

    This isn't the best example and I apologize if I am not making any sense.

  • I'm starting to live up to my name.

    Here is another random question:

    Is it possible to spawn an object at a distance away relative to other instances of that same object that are already on-scream/in-layout?

    EX: There are 2 or 3 instance of object "Baddie" (for lack of a better name) and I want to spawn another one during runtime, but it has to be at least "x" number of pixels away from ALL instance of "Baddie".

  • Thanks, it worked just like you said. Sorry for the late reply. I have been busy working on this and some other construct stuff.

  • Ok.So I have grid down.

    Now I've run into the issue of figuring out a way of snapping moving/movable objects to each space and preventing that space from being used by more than one object.

  • I pretty much understand how this works now. While I was playing around with it, I got some interesting results to say the least.

    It appears this doesn't work well with dynamically changing positions.

    meaning I set the code so the center point was an object with an 8-way behavior and the gird wouldn't stay on it. Instead it would group together and orbit the object. (great fun trying to get it be center again <img src="smileys/smiley36.gif" border="0" align="middle" />)

    Now I'm curious to see if I can get to to move the right way. <img src="smileys/smiley4.gif" border="0" align="middle" />

  • Wow thanks.

    This was driving me crazy. Although when I look at it, it looks so simple I feel kind of stupid that I couldn't figure this out.

    Thanks again. I should be able to modify it to work on a click a drag.

  • I'm here with another random question.

    Is there a way to create a gird with a special shape around a center point in the event sheet editor?

    I want to make an isolated hex grid in a hexagon shape like this: <img src="http://www.math.grin.edu/mcm-2000-problem-b.jpg" border="0" />

    Also I'm trying to make it as flexible as possible (changing size, number of grid spaces and so forth that's why I trying to make it in the event sheet editor)

    I think making it out of individual hexagons objects will take care of isolation issue.

    My second question is is there a way to have that grid rotate around a center point? Kind of like how some computer board games allow you to rotate the board.

  • Thanks both of you. I'll check it out.

  • I can't find the orbit plugin. Do I have to DL it or am I just blind?

    Couldn't I just set a PV for the orbit objects and see if the enemy with the the UID matches that PV and set it to follow that enemy?

    Well that's my theory anyway. I have tried it with little success though.

    For each OrbitShield

    ->Pick by comparison Baddy: Unique ID = OrbitShield.value(EnemyID)

    action: OrbitShield: set position:

    Baddy.X + cos(TickCount * 1.2 -OrbitShield.Value('TempRadialOffset')) * 70

    Baddy.Y + sin(TickCount * 1.2 -OrbitShield.Value('TempRadialOffset')) * 70

    BTW, thanks to the people on the forms for the circle/orbit code <img src="smileys/smiley20.gif" border="0" align="middle" />

    So anyone have any ideas? anyone?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Would Anyone know how to do/make a group movement

    EX: enemy has a surrounding shield of objects (rocks, ice, missiles, bombs, etc.) and it follows the enemy(s); you can get to the enemy(s) by destroying pieces of it(each object)?