Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / Re: Dropping items in in a stack on: 2014-07-16 05:00:20
Yes each block has its position stored.

The problem is, how do i subtract 1 or the amount needed from each item ABOVE the item that was removed??

2  Game Development / Newbie & Debugging Questions / Re: Dropping items in in a stack on: 2014-07-16 04:54:18
Right but in my game,

How do i shift each block down to replace the item below it?

something like:

blockA.moveTo(x,y);

Where y is equal to the position of the item below it?

3  Game Development / Newbie & Debugging Questions / Dropping items in in a stack on: 2014-07-16 04:48:22
I am making a game where i have items or blocks stacked on top of each other.

What i would like to do is, when the first item(or the item at the bottom of the stack) is removed, i would like to shift all the blocks above, down into the next position below it and add another block to the top of the stack.

Sort of like in a match 3 game.

Could someone provide instructions for doing this? or some type of psuedocode?

Thanks guys
4  Game Development / Game Play & Game Design / How does the game timberman work? on: 2014-07-15 15:58:57
Hey guys,

i am wondering how the game timberman works?

What do you guys think is the logic behind the programming in the game? For example,

1). how the tree and branches move down each time the player chops. How does the tree continue to move without running out? Maybe they use a really big graphic for the tree so it never runs out?

5  Game Development / Game Mechanics / Re: Assistance with Match-3 Style Game Logic on: 2014-02-24 18:14:41
Ok, so i have it semi-working with this code:


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
private void moveObjectsDown(int x, int y) {
     
     
      // TODO Auto-generated method stub
     
     
      for (GameObject o : gameObjects) {
         
         if(o.getX() == x && o.getY() == y+1){
           
            // Animation of an object position to the coordinates (100,200), in one second
           Tween.to(o, Accessor.POSITION_Y, 1.0f).target(y, y).start(game.tweenManager);
            //o.setPosition(x, y);
           
            y++;
           
           
         }
         
         
         
         
         
      }
     
   }/code]

This works flawlessly when only one item is removed from a row. But when i remove two items or more from a row, it only moves the items left in that column to the highest position.

I guess a way i could fix this would be to figure out the item with the lowest y position in that particular column and then drop the items according, but i am not sure how to do this.
6  Game Development / Game Mechanics / Re: Assistance with Match-3 Style Game Logic on: 2014-02-23 20:10:58
@LionKing

Nice! Thanks for that. I understand what your code does for the most part. :-)

A few questions, for the cell array, should this be a extended class of the sprite class as the data type?

And then create a method hasOccupant() in the Sprite class? Or does it have some type of other data type it should hold?

Also, how would i go about determining if a cell has an occupant?

Thanks so much man.
7  Game Development / Game Mechanics / Re: Assistance with Match-3 Style Game Logic on: 2014-02-21 14:35:56
So basically.

It first checks if a cell is empty or needs to fall. Then, if it is empty, we go up one row and move that item down to the empty position, and this will continue to happen for all the empty positions until the loop finishes? Correct?

But what if, more than 1 item is removed from a column? Or if more than 1 item is empty in column?

I ask because in my game, the user can connect as many matching sprites as possible. This means they can remove more than 1 item from a column, vs jus 3.
8  Game Development / Game Mechanics / Re: Assistance with Match-3 Style Game Logic on: 2014-02-21 14:25:45
Yes I will be using sprites.

But how do I iterate through to check if the sprite needs to be moved down?
9  Game Development / Game Mechanics / Re: Assistance with Match-3 Style Game Logic on: 2014-02-21 14:04:12
Judging from that statement I would say you need to take a step back fromd games and try to learn Java first. That is of a multi deminsional array type, which pretty much means it holds a bunch of references to blocks of memory (your objects). This is basic coding though, and I highly stress you stop trying to make a game and spend the time to learn programming first. You're only hurting yourself right now.

LOL. Actually i know java very well. I was asking what data type is it. Sprite, int, etc. ;-) I am fully aware of what an array is. This is like my 5th game. Just not sure how the match-3 thing works.

@Siesmic how do you go about updating the occupants each frame?

10  Game Development / Game Mechanics / Re: Assistance with Match-3 Style Game Logic on: 2014-02-21 12:15:49
Ah. Thank you for that. :-)

But how exactly does the cell[][] work?

Of what type is it?

And how do you go about updating the occupant?

I'm guessing get occup just returns the sprite.

Thanks a lot for your help so far!
11  Game Development / Game Mechanics / Assistance with Match-3 Style Game Logic on: 2014-02-21 05:09:52
Hi guys,

I would like to build a "connect the dots" style game.

I already know how to fill in the grid for the game and i know how to remove the objects when the user selects a pair.

The problem is, i am not sure how to fill in spaces when objects are removed.

For example, if 2 items are removed from row 1 and 1 item is removed from row 2. what would be the algorithm to drop the items in row 2 down to slots, and the items in row 1 down 1 position above where the item was removed.

I hope i exlained my question well. For this game i will be using Libgdx(which is java) so any java pseudocode will be GREAT. I will also be using sprites of libgdx and tween engine to move objects.


Thanks so much guys, hope i can find the help i need.
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (6 views)
2014-07-30 21:08:39

Riven (20 views)
2014-07-29 18:09:19

Riven (13 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (32 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (42 views)
2014-07-23 21:16:32

Riven (28 views)
2014-07-23 21:07:15

Riven (29 views)
2014-07-23 20:56:16
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!