Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by shrikantb

Hi,

I am new to impact js. I want to create Mario kind of jump and run game which would be endless. We have 3 life in the game and the game will be endless untill we finish all 3 lifes.

I am getting stuck at a point of endless logic. How can we add the background or create path unlimited while running? Do we need to create endless path design in weltmeister?

Is there any smart code there which can be run repetitively for creation of endless path to run?

Your help is really appreciated.

Thanks

1 decade ago by stillen

Theres a few ways to do this, depending on how you want the game to play.

You could make a level in weltmeister and check off repeat on the layer properties so that it repeats itself over and over again. The randomly spawn the platform and items off screen and when the player reaches the end of the layer, move him back to the beginning of it. That would apear as he's running endlessly, if the art was seamless.

You could also skip weltmeister and just spawn items, badguys etc and have them move to the player and have the player not move, so the player would be centered for example and the repeating world would move around him.

1 decade ago by TommyBs

I'd recommend taking a look at the 'Drop' game source on your download page, this is a good example as a starting point and something I'm using to make a similar type of game. The logic for making your game 'completable' in that there's always a platform, to run to is more difficult. In my game a user can't just 'drop' off the map for example, instead I place obstacles in the way for the user to dodge. I've implemented my own code (that I'm still refining) that works similar to this:

- place obstacle
- is there an existing obstacle in the previous row
- If there is, do they overlap. If so remove the new obstacle before the user sees it (taking into account screen edges, player sizes etc.)

Basically, when I place my obstacles, I always make sure there is a 'player' sized gap for the user to get through. The randomness though ensures that a user could still get stuck on a certain side however as the space might be on the opposite side to where they were.

1 decade ago by shrikantb

Quote from stillen
Theres a few ways to do this, depending on how you want the game to play.

You could make a level in weltmeister and check off repeat on the layer properties so that it repeats itself over and over again. The randomly spawn the platform and items off screen and when the player reaches the end of the layer, move him back to the beginning of it. That would apear as he's running endlessly, if the art was seamless.

You could also skip weltmeister and just spawn items, badguys etc and have them move to the player and have the player not move, so the player would be centered for example and the repeating world would move around him.


----------------------------------------

Thank you very much for the reply. The player not move and repeating world would move around him approach is good for me. Can you please tell me how can I create collision layer by coding (without using weltmeister).

Your help is appreciated.

Thanks.

1 decade ago by stillen

I would take a look at the code that @TommyBs mentioned.

You can spawn new entities in semi-randomn locations . There is actually a good tutorial on how to set up the logic of an endless runner online but it uses Corona SDK. You can use the concepts, but write it in impact.
http://mobile.tutsplus.com/tutorials/corona/corona-sdk-create-a-side-scroller-from-scratch/

I would set all the "land entities" move at the same speed toward the hero and destroy themselves when then fall off the screen. I don't think there is a concept of groups in impact, like there is in Corona. Between both sets of code, you should be able to get the concept and something up and running.

This link might be helpful too:
http://impactjs.com/forums/help/dynamic-collisions-and-variable-player-size/page/1

1 decade ago by shrikantb

This really help me to build my endless game.
Thank you very much for your valuable help. Your help is really appreciated.
Page 1 of 1
« first « previous next › last »