Semo's Forum Posts

  • Just had a thought that might work and would take much less events.

    I have some planets that orbit a star. I wanted them to have a random starting position at the start of every game so i made a global variable which is set at the start of the layout to random(360). The planets take their stating position from the global variable. If you would create a radius outside the layout size they would spawn at a random location outside of the layout size. Of course an enemy that spawns at 45 degrees would enter the layout sooner then an enemy that spawns at 90 degrees but as long that doesn't matter it should work.

    global variables

    radius = number bigger then the layout

    randomspawn = random(360) you can set this at on every tick

    spawn X and Y

    sun.X+cos(randomspawn)*radius

    sun.y+sin(randomspawn)*radius

    Edit: Sun is obviously the center of the layout <img src="smileys/smiley2.gif" border="0" align="middle" />

    Example

    dl.dropbox.com/u/139739932/test/randomspawn.capx

  • A simple way would be to add another condition to the movement controls that checks if the player is shooting or not. Amusing you are using custom controls.

    event:

    condition 1: keybord right arrow is down > move right

    condition 2: keybord <inverted> space is down

    This way when space is down the movement will not trigger.

  • Well this is handy i was just about to implant this into my game but now i don't have to figure it out myself. Thanks!

  • You have to give the sprite an "instance variable" and change the type to "boolean". Add a key that toggles it. When true set visible. when falls set invisible.

    Here's an example

    dl.dropbox.com/u/139739932/test/boolean.capx

    Hope this helps

  • You should read the beginners guide to construct 2

    scirra.com/tutorials/37/beginners-guide-to-construct-2

    Even if its not a bingo game it will help you understand construct 2.

    But let me get you started.

    Creat a text on the layout.

    Go to the event sheet.

    Event > system > on start of layout

    Action > set text > random(1,100)

    You just created a random number.

  • Here is an example that helped me out with a similar question.

    dl.dropbox.com/u/139739932/test/RotateAroundObject.capx

    I can't find the thread to which it belongs atm because it was not my question and i didn't reply to it. Hope it helps.

  • 1. Yes that helped a lot! If it means having a 100 sleeping physic objects is no problem then thank you!

    2. I did but lets say my player is a physic and has the solid behavior. I want to give it a shield around him which is also a solid. They would collide and freak out. How would i fix this?

  • The manual tells me that a physics object is asleep when not moving. Thus not eating any cpu power.

    Would a "set position" or a "rotation behavior" wake them up?

    If the answer is no does that mean i can have a lot of sleeping physic objects without creating a heavy load?

    If the answer is yes then could someone please explain to me how i would make a physics object collide with a solid object?

    Edit: In fact could you guys answer both question?

  • Open world space game where players can design and built their own ships, bases and what not. Colonize a planet and built a city. Built a base inside an asteroid. Built a space station to trade with other players.

    Expand on what eve has. Add design features spore offers and the the smooth transition between planet and space from ksp.

  • Hey guys thanks for all the replies!

    I'm not using the beta atm so i could not open your examples. Downloaded it today. Anyway I had a friend over last night and we figured it out.

    Credit goes to my friend but here is what he came up with.

    Apply physics force: (1-(distance(player.X,player.Y,sun.X,sun.Y)/512))/2

    512 is just half of the layout size

    Here's the example

    dl.dropbox.com/u/139739932/test/gravity%20test%202.capx

  • Hello

    I am Chiel from The Netherlands. I'm a gamer and i never thought i would make a game myself until i tried out Construct 2. I followed the beginner's guide to Construct 2 and was surprised what i had achieved in such a small amount of time. That was it. I was hooked and wanted to do more.

    I'm currently building my first game in the free version. My plan was to get the most out of that first and release a demo. After that i'm planning to buy the personal version and finish the game.

    I'll post a video later today or tomorrow in the "what you're working on" thread so keep an eye out for that.

  • Try Construct 3

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

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

    I'm building my first (space)game and its coming along great. I just added some physics to it which was surprisingly easy to do after a bit of reading. My planets now have gravity!

    Atm i'm comparing 2 value's to see if the ship is in range for the force to take affect. Its working as intended however i would like the force to increase in strength as the ship gets closer to the planet.

    I figured this could be done by dividing the force with the distance between the ship and the planet. That way the force would be lower if you are further away from the planet. The only thing is i have no idea how to set this up.

    Here is a link to my test built

    dl.dropbox.com/u/139739932/test/grafity%20test.capx

  • Thank you. It has exactly what i was looking for. Should have checked this tutorial first before posting here. I'm going to continue reading now because i have a feeling i can learn a bit more from this tutorial.

    Thanks!

  • Hello i'm currently working on my first (space)game using the many tutorial that are available.

    I'm currently using the "Car behavior" to move my player/ship around which is working great. However i was wondering if it was possible to rotate my ship and still keep the direction i was going. Right now when i turn my ship i fly in the direction i'm steering.

    I would also like to know how i can rotate my ship when its not moving. Adding a rotation cancels the drift behavior from the car.