random obstacles( multiple obstacles not just one)

pranshudhungana21pranshudhungana21 Member, PRO Posts: 20
edited May 2016 in Help Wanted

So i have finaqlly found a way to make my spikes scroll. Now i need some help with my obstacles. Basically at the moment since its just a prototype i have 4 obstacles and i though of doing something like this:
have 4 different actors (different shapes) and 1 speed attribute and 1 spawn attribute and 1 shape attribute.
Have a rule every 0.25 seconds, have something like a random number generator pick between 1 and 4. If 1 spawn shape actor 1, 2 spawn shape actor 2, etc. Then they will be positioned randomly along the y axis so something like random ( 285,200) but they will also move at the same speed as my scrolling background. Tjis idea works but i am having a hard time actually making this idea into a script for my spawner. Any ways on how to do this or a template if you made something like this? I am still quite new and need to know functions a bit better :smile:

Comments

  • pranshudhungana21pranshudhungana21 Member, PRO Posts: 20

    I meant vertically moving spikes *

  • TobyToby Member Posts: 478
    1. Create an offscreen plain actor to loop / spawn spikes at the desired x/y location at a specified timed interval. You can use the clock function or the Timer :smile: function to achieve this. Smaller timed gaps mean closer spikes, larger times greater distances between those spikes.

    2. Create your individual spike actor to be spawned and add a move or accelerate action to it in the direction you want. Constrain the position of the Y axis of your spike to the bottom of the screen e.g. 10

    3. Create a rule inside the spike... if spike actor X position => a specified distance in X off screen - destroy this actor.

    That should do it.

  • pranshudhungana21pranshudhungana21 Member, PRO Posts: 20
    edited May 2016

    Thnx but this was not what i meant i meant the spikes to be like a scrolling kind of background so something like this

    https://play.google.com/store/apps/details?id=com.ketchapp.hophophop

    except vertically. Where you have to avoid the spikes and the obstacles but i will have different obstacles and controls but spikes are the same but vertically scrolling . Basically want to scroll vertically

  • IceboxIcebox Member Posts: 1,485

    @pranshudhungana21 Hey is this what you mean ? i attached a demo in case you want it hope it helps

  • pranshudhungana21pranshudhungana21 Member, PRO Posts: 20
    edited May 2016

    not really but the obstacles spawning kind of helps but all i wanted help with is just a vertically scrolling background which scrolls forever and the background was going to be a really spikey one but thank you nevertheless for giving me an idea of randomly spawning spikes which i could use as an obstacle

  • IceboxIcebox Member Posts: 1,485

    @pranshudhungana21 oh i thought you had problems with spawning , if you just want to go vertically change attribute motion linear velocity y to -value (down) +value(up) or you can use any of the move behaviors and set the direction up or down. Goodluck

  • 8bitninja8bitninja Member Posts: 367

    Is this what you are talking about?

    If so you can buy the template here: Endless Wall Jumper Template

  • pranshudhungana21pranshudhungana21 Member, PRO Posts: 20

    yeah
    This is what i meant but really i just wanted to scroll vertically to put it simply so is there anything that could teach me how to scroll cause none of the courses do

  • pranshudhungana21pranshudhungana21 Member, PRO Posts: 20

    Nvm i got how to do it from ice boxes help thnx so much icebox

  • pranshudhungana21pranshudhungana21 Member, PRO Posts: 20

    Is there a way to close this?

  • pranshudhungana21pranshudhungana21 Member, PRO Posts: 20

    i need to change the topic of this i am very close to finishing my game :) and i need some help with the obstacles

  • fmakawafmakawa Member Posts: 565

    @pranshudhungana21 start a new thread

  • pranshudhungana21pranshudhungana21 Member, PRO Posts: 20

    thts what i did and ice box helped me once again !

Sign In or Register to comment.