How to create a terrain like in the game "worms"?

Learn how to start making games.

How to create a terrain like in the game "worms"?

Postby Kcee » Thu Apr 06, 2017 8:18 pm

No offence but this topic is only meant for people who has seen and played WORMS game. How do I create that type of terrain or platform?
Currently working on: Super Stick Brawl.
User avatar
Kcee
 
Posts: 265
Joined: Tue Feb 14, 2017 5:40 pm
Location: Dimension GE
Score: 13 Give a positive score

Re: How to create a terrain like in the game "worms"?

Postby ITomi » Fri Apr 07, 2017 8:32 am

Hello Kcee!

In my game in preparation I use an array to build up the levels and I read out the values from this array with a loop.
For example:

Code: Select all
int i,j,xplace,yplace;
char level[2][30] =
{
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,0,0,0,0,0,1},
};


In this array 0 means nothing, 1 means a piece of wall. And you can build up the level with a loop:

Code: Select all
for(j = 0; j < 2; j++)
{
  for(i=0; i < 30; i++)
  {
             switch (level[j][i])
             {
              case 1: CreateActor("wall", "wall", "no parent", "no path",xplace,yplace,true);
              break;
             };
             xplace+=wall.width;
  };
  xplace-=wall.width*i;
  yplace+=wall.height;
};


I think, you can build up a terrain or platform similar way in your game, just "draw" your terrain in an array.
User avatar
ITomi
 
Posts: 48
Joined: Sun Aug 21, 2016 1:56 pm
Location: Hungary
Score: 5 Give a positive score

Re: How to create a terrain like in the game "worms"?

Postby Kcee » Fri Apr 07, 2017 9:07 am

Awesome. Thanks.
Currently working on: Super Stick Brawl.
User avatar
Kcee
 
Posts: 265
Joined: Tue Feb 14, 2017 5:40 pm
Location: Dimension GE
Score: 13 Give a positive score

Re: How to create a terrain like in the game "worms"?

Postby juansimat » Fri Apr 07, 2017 9:08 am

You can accept the answer from ITomi if it's sufficient for you. I played the first game and the way to achieve the same effect you'll need to draw the landscape with canvas and implement your own bitmap buffer also to reinvent the per-pixel collision. For the bitmap, I think someone already tried/acomplished that in the forums. The collision could be problematic, but maybe with boundaries you can reduce overhead.
In conclusion, if it's possible to do in gameEditor, it's a hard work.
̿̿¯̿̿¯̿̿'̿̿̿̿̿̿̿'̿̿'̿̿̿̿̿'̿̿̿)͇̿̿)̿̿̿̿ '̿̿̿̿̿̿\̵͇̿̿\з=(๏̯͡๏)=ε
User avatar
juansimat
 
Posts: 152
Joined: Sat Dec 19, 2009 8:23 am
Score: 27 Give a positive score

Re: How to create a terrain like in the game "worms"?

Postby ITomi » Fri Apr 07, 2017 1:27 pm

And I think, you can replace the actors (e.g. wall) with simple pixels, if you use the putpixel() command. But I don't know, how does works the drawing commands: for example I couldn't light a pixel with it :?
User avatar
ITomi
 
Posts: 48
Joined: Sun Aug 21, 2016 1:56 pm
Location: Hungary
Score: 5 Give a positive score

Re: How to create a terrain like in the game "worms"?

Postby juansimat » Fri Apr 07, 2017 4:08 pm

ITomi wrote:And I think, you can replace the actors (e.g. wall) with simple pixels, if you use the putpixel() command. But I don't know, how does works the drawing commands: for example I couldn't light a pixel with it :?


It depends on the quality / number of actors. If you reduce the size, the monopixel actor count can be huge and overload.
̿̿¯̿̿¯̿̿'̿̿̿̿̿̿̿'̿̿'̿̿̿̿̿'̿̿̿)͇̿̿)̿̿̿̿ '̿̿̿̿̿̿\̵͇̿̿\з=(๏̯͡๏)=ε
User avatar
juansimat
 
Posts: 152
Joined: Sat Dec 19, 2009 8:23 am
Score: 27 Give a positive score


Return to Getting Started

Who is online

Users browsing this forum: No registered users and 1 guest