fm4fanAT's Forum Posts

  • Here you have, as almost always, different options

    make a loop

    so you don't spawn directly and run a loop where the loop checks if the new spawn point is greater than 30 (check it against a variable you set when an object gets created)

    Or you could make it with an array and spawn points (invisible sprite objects where the new objects get spawned) so instead of pixels you spawn them from the boxes - this is very useful if you want the objects get spawned evenly across the screen.

    Also with a loop, but here you can decide very precisely what you want to do.

    Or you could make a small random number and multiply it by 30 (still you need a loop to check where the last spawn happened). Th long version would look like this floor(random (0, windowWidth/30))*30

  • A great talk from the GDC15 just hit youtube

    Efficiency for Game Designers Lessons Learned Making Gunpoint Quickly Without Going Mad

    Subscribe to Construct videos now

    It's a talk from Tom Francis first game Gunpoint (his first game he has ever made with game maker).

    His talk is about time management for ideas and how he worked as a one man show.

    It's an hour long, but worth it.

  • Hi,

    Ken95

    I looked at your capx and I could have changed that, but I thought it could be done a little bit nicer than yours.

    But I made it not near as elegant as Paradox (or beautiful)

    https://www.dropbox.com/s/hedlen42i1uvb ... .capx?dl=0

    Paradox does int(random(10)) give you really a perfect random number? I thought you should use (because of rounding)

    "floor ((random(1, 10))"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The X and Y coordinates start on the top left corner with 0,0

    So if your game is 1280px by 720px the right bottom corner would be 1280, 720

    If you want a mouse movement only occur on the top half you just take 360 (720/2).

    So the 400 only represent some random Y value I took - so the mouse only follows if the mouse is maximum 400 away from the top.

    To stop mouse movement if your cursor is off screen you can add another event like

    if smaller then windowWidht (or WindowHight depending if X or Y)

    and greater then 0

  • It's not exactly a degree thing, but for e.g. platformers this would work nicely

    You would need to make another condition to your set angle mouse event

    you could make an invisible object and add condition if NOT over invObeject > follow mouse

    or even better

    system > compare values

    first = Mouse.Y

    <

    second = 400 (so only follow if not greater then Y 400)

    same for Mouse.X and you are done

    edit: changed some typo

  • Hi,

    this reminds me of the Simon Says tutorial

    https://youtu.be/RTiCVoGfyk8

    With this - I'm pretty sure - you can solve your problem, but it works with arrays and so maybe is not how you made your game (or would like to).

    ps. if you like send me your capx and I take a look

  • I'm not sure about your question

    Yes, I think, it's easier to make all 50 Monsters in Photoshop (or wherever) then position and stack different bodys/heads/eyes inside C2.

    If your question is about the details/stats of each monster - I would look into XML. Not the easiest to understand, but very flexible.

    Here you can write down every single property of your monster and fetch whatever you need out of the XML

    Starting point https://www.scirra.com/tutorials/354/xml-parsing

    way more detailed

    Subscribe to Construct videos now
  • In my example I run the for each

    and my enemys are in this case just another frame from the animation (but can be whatever you want)

    system for each objEnemy | set animation frame to > choose (0,1,2,3)

    https://www.dropbox.com/s/y4ixsuyuzo0pj ... .capx?dl=0

  • Good question - and I have no clue how to solve it

    But I have a work around - you could make a mouth up and down animation instead of a single frame. I think in this example it would work nicely.

    The other (stupid) idea I had was to jump trough a cycle of different origin points.

  • Hi,

    If you look at this tutorial for a jumping ball http://www.mediafire.com/download/olczm ... +Ball.capx

    (Tutorial on Youtube

    Subscribe to Construct videos now

    )

    and then combine that with a flappy bird tutorial (there are plenty of them out there) you basically have your game you asked

  • There are many ways

    make a sprite on the top left corner

    Events

    system > every tick | objSprite > set position to > X= lerp (Self.X, 500, dt) Y= lerp (Self.Y, 500, dt)

    this makes a transition from the current X and Y position to XY500 and the speed it uses is delta time

    I used delta time, because it is framerate independent.

    Here is the explanation from the manual

    lerp(a, b, x) Linear interpolation of a to b by x. Calculates a + x * (b - a).

    for dt (delta time) http://www.scirra.com/tutorials/67/delt ... dependence

  • Here is one solutions (didn't test it)

    Let's say your tiles are 50x50px

    You click on a spot somewhere - let's take 205, 140

    You could store this values in a variable and now do a little bit of math (here I call the variable vX and vY)

    floor (vX / 50) * 50 and the same but with vY

    floor just round the number down, so the result would tell you wich tile it is and so if multiplied by the tile size you get the position of the tile. If the origin point is not on the top left but in the center you would need to add 25 to your calculation.

  • in this case yes

    to change that you could make a more precise random number

    random (30,(WindowWidth-30))

    Now the number starts at 30 and ends 30 pixels left of your layout.

  • create a Sprite and add a bullet behaviour

    Event

    system > on start of layout | objSprite > destroy

    system > every 2 seconds | system > create objSprite on layer=0; x=random (WindowWidth); Y=-30

    add action > objSprite > set Bullet angel of motion=90

  • try a new project

    create one sprite with fade behaviour > name it objSprite

    set the fade properties to active on start < no

    fade out time > 8

    now in the event sheet

    system > on start of layout | objSprite > destroy

    system > every 2 seconds | system > create obj sprite [layer = 0, x= random (WindowWidth), Y= random (WindowHeight)] //the order of the actions is important

    add action > objSprite > set fade in time = random (0,5)

    add action > objSprite > Fade: start fade