Skip to main content
Edited question to specify that the framework Greenfoot is used, and removed an odd expression that didn't fit the new wording, and didn't provide any relevant information anyway.
Source Link
aaaaaaaaaaaa
  • 8.9k
  • 1
  • 23
  • 35

I'm working on a college project atusing the minuteeducational Java framework Greenfoot, and as stated above we're making an r-type clone.

I've been looking at using an array of strings to populate the levels. The array contains 60 strings, filling the Y axis, each element in the array represents a y co-ordinate += 10. I use "0" to represent empty space, "1" to represent a block of terrain.

Then I use a for loop and charAt() method to create a new array representing each column along the X axis, and populate the screen this way.

I thought I was being clever by making a "block" class that checked to see if it was connected to any other blocks and adjust it's image accordingly to make the terrain look as if it's a single block/shape. However, this is now slowing down the game to a crawl as there are so many objects in it.

I've tried to add the columns as the game is scrolling and removing them once they leave the screen, but I end up with gaps in the terrain.

How are levels in these types of game normally implemented? Would I be better creating a few big objects to make the terrain and build the whole level from start to finish?

Is there some method I've completely missed?

Here is a screen shot of how it looks at the minute, each block is 22 x 10 pixels. Game Screenshot - too many block objects

I'm working on a college project at the minute, and as stated above we're making an r-type clone.

I've been looking at using an array of strings to populate the levels. The array contains 60 strings, filling the Y axis, each element in the array represents a y co-ordinate += 10. I use "0" to represent empty space, "1" to represent a block of terrain.

Then I use a for loop and charAt() method to create a new array representing each column along the X axis, and populate the screen this way.

I thought I was being clever by making a "block" class that checked to see if it was connected to any other blocks and adjust it's image accordingly to make the terrain look as if it's a single block/shape. However, this is now slowing down the game to a crawl as there are so many objects in it.

I've tried to add the columns as the game is scrolling and removing them once they leave the screen, but I end up with gaps in the terrain.

How are levels in these types of game normally implemented? Would I be better creating a few big objects to make the terrain and build the whole level from start to finish?

Is there some method I've completely missed?

Here is a screen shot of how it looks at the minute, each block is 22 x 10 pixels. Game Screenshot - too many block objects

I'm working on a college project using the educational Java framework Greenfoot, and as stated above we're making an r-type clone.

I've been looking at using an array of strings to populate the levels. The array contains 60 strings, filling the Y axis, each element in the array represents a y co-ordinate += 10. I use "0" to represent empty space, "1" to represent a block of terrain.

Then I use a for loop and charAt() method to create a new array representing each column along the X axis, and populate the screen this way.

I thought I was being clever by making a "block" class that checked to see if it was connected to any other blocks and adjust it's image accordingly to make the terrain look as if it's a single block/shape. However, this is now slowing down the game to a crawl as there are so many objects in it.

I've tried to add the columns as the game is scrolling and removing them once they leave the screen, but I end up with gaps in the terrain.

How are levels in these types of game normally implemented? Would I be better creating a few big objects to make the terrain and build the whole level from start to finish?

Is there some method I've completely missed?

Here is a screen shot of how it looks at the minute, each block is 22 x 10 pixels. Game Screenshot - too many block objects

Tweeted twitter.com/#!/StackGameDev/status/144466838653382656
deleted 1 characters in body; edited title
Source Link
user1430
user1430

How toshould I implement side scrolling-scrolling level design (Java, R-Type style Game)?

I'm working on a college project at the minute, and as stated above we're making an r-type clone.

I've been looking at using an array of strings to populate the levels. the The array contains 60 strings, filling the Y axis, each element in the array represents a y co-ordinate += 10. I I use "0" to represent empty space, "1" to represent a block of terrain. I then

Then I use a for loop and charAt() method to create a new array representing each column along the X axis, and populate the screen this way. I

I thought I was being clever by making a "block" class that checked to see if it was connected to any other blocks and adjust it's image accordingly to make the terrain look as if it's a single block/shape. However, this is now slowing down the game to a crawl as there are so many objects in it.

I've tried to add the columns as the game is scrolling and removing them once they leave the screen, but I end up with gaps in the terrain.

How are levels in these types of game normally implemented? Would I be better creating a few big objects to make the terrain and build the whole level from start to finish?

Is there some method I've completely missed?

Here is a screen shot of how it looks at the minute, each block is 22 x 10 pixels. Game Screenshot - too many block objects

How to implement side scrolling level design (Java, R-Type style Game)?

I'm working on a college project at the minute, and as stated above we're making an r-type clone.

I've been looking at using an array of strings to populate the levels. the array contains 60 strings, filling the Y axis, each element in the array represents a y co-ordinate += 10. I use "0" to represent empty space, "1" to represent a block of terrain. I then use a for loop and charAt() method to create a new array representing each column along the X axis, and populate the screen this way. I thought I was being clever by making a "block" class that checked to see if it was connected to any other blocks and adjust it's image accordingly to make the terrain look as if it's a single block/shape. However, this is now slowing down the game to a crawl as there are so many objects in it.

I've tried to add the columns as the game is scrolling and removing them once they leave the screen, but I end up with gaps in the terrain.

How are levels in these types of game normally implemented? Would I be better creating a few big objects to make the terrain and build the whole level from start to finish?

Is there some method I've completely missed?

Here is a screen shot of how it looks at the minute, each block is 22 x 10 pixels. Game Screenshot - too many block objects

How should I implement side-scrolling level design?

I'm working on a college project at the minute, and as stated above we're making an r-type clone.

I've been looking at using an array of strings to populate the levels. The array contains 60 strings, filling the Y axis, each element in the array represents a y co-ordinate += 10. I use "0" to represent empty space, "1" to represent a block of terrain.

Then I use a for loop and charAt() method to create a new array representing each column along the X axis, and populate the screen this way.

I thought I was being clever by making a "block" class that checked to see if it was connected to any other blocks and adjust it's image accordingly to make the terrain look as if it's a single block/shape. However, this is now slowing down the game to a crawl as there are so many objects in it.

I've tried to add the columns as the game is scrolling and removing them once they leave the screen, but I end up with gaps in the terrain.

How are levels in these types of game normally implemented? Would I be better creating a few big objects to make the terrain and build the whole level from start to finish?

Is there some method I've completely missed?

Here is a screen shot of how it looks at the minute, each block is 22 x 10 pixels. Game Screenshot - too many block objects

Source Link
mal
  • 409
  • 4
  • 16

How to implement side scrolling level design (Java, R-Type style Game)?

I'm working on a college project at the minute, and as stated above we're making an r-type clone.

I've been looking at using an array of strings to populate the levels. the array contains 60 strings, filling the Y axis, each element in the array represents a y co-ordinate += 10. I use "0" to represent empty space, "1" to represent a block of terrain. I then use a for loop and charAt() method to create a new array representing each column along the X axis, and populate the screen this way. I thought I was being clever by making a "block" class that checked to see if it was connected to any other blocks and adjust it's image accordingly to make the terrain look as if it's a single block/shape. However, this is now slowing down the game to a crawl as there are so many objects in it.

I've tried to add the columns as the game is scrolling and removing them once they leave the screen, but I end up with gaps in the terrain.

How are levels in these types of game normally implemented? Would I be better creating a few big objects to make the terrain and build the whole level from start to finish?

Is there some method I've completely missed?

Here is a screen shot of how it looks at the minute, each block is 22 x 10 pixels. Game Screenshot - too many block objects