Semo's Recent Forum Activity

  • Short demo video of my first game ever. Still vary much a wip.

    The title is a placeholder. The project has not been named yet.

    I would suggest you watch it full screen ;)

    youtu.be/kJhf1sswElk

    [tube]kJhf1sswElk[/tube]

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • First screenshot of my first game. Still vary much a wip but i'm making good progress.

    <img src="http://imageshack.us/a/img26/2016/testqw.jpg" border="0" />

  • Or pin depending what you need i guess

  • System > every tick > set position > player.x,player.y

  • Depends on how many backgrounds you need. If you only need 2 then you can use an "instance variable" and set the type to "boolean"

    Set a key to "toggle" the "boolean".

    When "true" set background 1 to "visible" and background 2 to "invisible"

    When "false" set background 1 to "invisible" and background 2 to "visible"

  • Glad i could help someone else for a change ^_^

  • Ah i see my mistake. I used system "is between values" instead of sprite "is is between" Silly me.

    One thing though. You used an instance variable for angleBetween which does not work because "is between values" does not take 0 with a an instance. Changed it to a global variable and that did the trick!

    Thanks a lot for explaining it.

  • Thanks for all the replies.

    -snip- image

    This did not work for me and looking at what AkiraWong wrote i think i know why. "Is between values" does not let me set a value as >=

    Global variable:

    random = 0

    radius = 200

    Instance variable:

    Sprite2 (angleBetween = 0)

    Event:

    Every tick >

    Set random to (random+1)

    Sprite2 (Set position to (sun.X+cos(random)*radius, sun.Y+sin(random)*radius"))

    Sprite2 (Set angleBetween to (angle(sun.X,sun.Y,Sprite2.X,Sprite2.Y))

    Here control the angle which you don't want object to spawn~

    For your case:

    if Sprite2 (angleBetween <= 130) or (angleBetween >= 140)

    Sprite2 spawn GreenDot on layer 0 (Image Point 0)

    You may ask my angle is between 220 & 230~

    But why the angle in the code is (<= 130) or (>= 140)~

    That's because the calculation of angle(x1,x2,y1,y2)~

    The return answer is between (-180 to 180 degrees)~

    Start from opposite direction of the object~

    Yup. That's it. Hope it help. (^_^)

    I understand what you wrote and thanks for explaining how the degrees work. However like i said above it wont let met change it to >=. I also don't get why you put a +1 to random.

    While AnD4D solution seems to work it still bothers me that i can't get it to work with your or shinkan solutions. Sorry to ask this but maybe a capx file would help me understand.

  • Hello

    I want to spawn an object in a random location around another object. I have this working however now i want to cut out a piece of the pie. The object should not spawn between 220 and 230 degrees however i can't get this to work. I have some idea's of how it might work but i just don't see how i would implant this atm.

    Here's an example of the 360 spawn

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

  • 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!

Semo's avatar

Semo

Member since 29 Jan, 2013

None one is following Semo yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies