making N64 pokemon puzzle league NEED HELP

Started by
7 comments, last by Telamon 18 years, 9 months ago
I am doing it in java. I need to know a way to compare 3 blocks if the borders are next to each other? any ideas? and whats the best way to swap the blocks? I will post it here when im finished to see what you guys think of it and probably test it out. thanks for looking
Advertisement
How are the blocks represented in your program code? What exactly is a block, and how are they arranged? You mentioned checking of blocks share borders; this may be easy and may be complex depending on the blocks and what the player does with them. For instance, if the blocks are in a square grid, it's fairly easy; if they're just floating around in 3D space, though, it gets a little more complex.

Maybe you could provide some additional details on how the game works (I'm not familiar with Pokemon Puzzle League) and what you need to accomplish?

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

LoL, maybe you should get into your project before asking such questions.
It is rather broad.

Also, As I was saying in a thread the other day, often if you wait till the problem has arrived it will be solved or the situation may have changed.

I would have all the blocks in a dll list of sometype maybe or maybe a list which can point up, down, next, prev... There are a billion methods of solving this. I suggest you get you game engine up and ask again.
I'm familiar with the game: it's the same as Tetris Attack for the SNES. Basically, it's a block-based game roughly in the same family as Tetris, Dr.Mario etc., except the blocks rise up out of the bottom of the screen and you are competing against a second player. You can manipulate the blocks by swapping over two horizontally consecutive blocks (which swaps their position). The idea is to link three or more similarly patterned or coloured blocks in a horizontal or vertical line, where they vanish and any blocks they support fall down due to gravity. If you plan it, you can get chains of links to occur one after another, which results in penalty blocks being dropped on the other player.

Anyway, Ultimate_Fusion, I don't see why you shouldn't be able to implement this with a big gird to represent the blocks. You only need to compare the blocks with its neighbours after they move; either by the player swapping them (that's only two to compare) or when new blocks are introduced at the bottom of the screen or by being dropped by the other player. Swapping the blocks is as simple as swapping the values in the grid. I'd favour this at least to start as it's easy to code, easy to understand and easy to debug.

Hope that helps!

The game is as described by trapper zoid
i have got into the program and thats why im stuck.
"You only need to compare the blocks with its neighbours after they move"
how would I do this, I only know how to deal with collision and collision prevention at the moment in java?

i am storing the location in a array but it is getting abit troublesum.
if I was to use an array which is better 1d or 2d?
But I would rather make it run like a game. the objects move by themselfs so i only need to search for matches. i'll post what I have if you have code tags on this forum or upload, i cant seem to find it? upload would be better since I have a couple of pictures to the game

[Edited by - Ultimate_Fusion on June 29, 2005 5:51:56 AM]
I own Tetris Attack for the SNES, awesome game :)
Pokemon Stadium was okay, a fun game like Tetris Attack but it was Pokemon so I got annoyed with it.

Are you using C++????

If you are using C++ then I suggest a 1D array, it would make life easy.
But you need to know more than whats beside each block. Each block has to be able to communicate rather simply with all other blocks. (Chains for example)

This is why I said put it in a DLL (double-linked list), or if there is a such term, a Quad-Linked List -- a list where each element wholds next, prev, up, down. That way you can jump around the blocks very simply.



Have you even started on the game?
I highly doubt it by your question. You should get started, as other, larger problems are going to arrise.
Quote:Original post by Ultimate_Fusion
The game is as described by trapper zoid
i have got into the program and thats why im stuck.
"You only need to compare the blocks with its neighbours after they move"
how would I do this, I only know how to deal with collision and collision prevention at the moment in java?


What I mean is that you only need to compare the blocks when you have to. If I remember the game, the only way you can get a new three-in-a-row combination is by swapping blocks over, or when new blocks are introduced into the system (either through the bottom of the screen or dropped through the top). So you only need to compare the blocks at that point in time, not every frame of the game.

Quote:
i am storing the location in a array but it is getting abit troublesum.
if I was to use an array which is better 1d or 2d?
But I would rather make it run like a game. the objects move by themselfs so i only need to search for matches. i'll post what I have if you have code tags on this forum or upload, i cant seem to find it? upload would be better since I have a couple of pictures to the game


Personally, I would use a 2D array, as it makes it a lot simpler to conceptualise (I'm a bit rusty on Java, 2D arrays are the same as in C/C++, yes?). That way, if you want to compare the neighbours of game_grid[7][4], you only need look game_grid[7][3], game_grid[7][5],game_grid[6][4] and game_grid[8][4]; something more complex like the graph system that Halsafar suggested would be overkill for this problem (in my opinion).

Oh, and I'm pretty new to this forum myself, but I think you can use (source "lang=java")(/source) tags to post code here, except with square brackets around the tags (how do you post square brackets around "source" without thinking it's a tag?). I guess you have to use HTML for images, but you'll have to store them on your own webpage.
I just finished a game similar to tetris that utilized several grids that had to be filled up by placing different shapes into them. The gameplay is a little different from what you are going to do but the management could roughly be the same (and from the sounds of it, even easier than what I had to go through). At any rate, I stored the grids as a 2D boolean array (you could use an array of ints with each int specifying the type of block, or an array of objects with more functionality if necessary). It can get complex working with grids of data so make it easy on yourself and emulate the game screen in code with a 2D array instead of a 1D.

I would have this grid store the state of the game regardless of the blocks animating to position and have the individual blocks store their grid location. When you add or remove blocks, update the grid and let the blocks look at their position in the grid and update themselves to reach the desired position. That's the approach I'd start with if I was doing your game.
Hey you might check out my TetrisAttack Demo which solves some of these problems. I've never played Pokemon Puzzle league, but I've had it described to me as being very similar.

Good luck with you game

Shedletsky's Bits: A Blog | ROBLOX | Twitter
Time held me green and dying
Though I sang in my chains like the sea...

This topic is closed to new replies.

Advertisement