Rotaion for Puyo Puyo game written in JAVA

Unable to Rotate Puyo Piece for Puyo Puyo Game

Page 1 of 1

2 Replies - 2655 Views - Last Post: 04 December 2009 - 01:35 PM Rate Topic: -----

#1 Riz 01   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 27-August 09

Rotaion for Puyo Puyo game written in JAVA

Posted 04 December 2009 - 09:40 AM

Hello everyone, i am almost finished with my Puyo Puyo game but i need some help concerning rotation. Puyos fall in pairs side by so in order to rotate them one puyo is the pivot point while the other puyo moves around it clock wise until it goes back to its original position.

I have one part of the rotation working when i press the Up key the Puyo moves to the top but from here i cant seem to figure out how to have it move to the right, then down, and then back to the original position.

Ive tried using the same logic i used the first time i was able to rotate the puyo UP but it doesn't work the way i want it to the puyo moves in a totally different direction. I am assuming this happens because its checking where the puyo was originally and then rotates it from there which would cause it to then moves in a totally different direction.

So does anyone have any ideas on how i could solve this problem? I considered creating a temporary piece so it would be able remember the last position it was and update from there but i feel like there is an easier solution to this. Anyway if anyone can help i appreciate it sorry for the lengthy question. Here is my code so far

 public void puyoRotation(){
			 
	  //in my code i create two currents which represent two puyos
	 //in order to get there x and y locations i divide them by the image
	//width and height and then i add one to the why to check if there
   // is anything above it if not then it is allowed to move into its new
  //position

   if(puyolist[current[0].x/image_height][current[0].y/image_height + 1] == null) {
			  current[0].x+=image_height;
			  current[0].y-=image_height;	
	 }
	}

This post has been edited by Riz 01: 04 December 2009 - 09:42 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Rotaion for Puyo Puyo game written in JAVA

#2 bsaunders   User is offline

  • D.I.C Addict

Reputation: 44
  • View blog
  • Posts: 571
  • Joined: 18-January 09

Re: Rotaion for Puyo Puyo game written in JAVA

Posted 04 December 2009 - 12:31 PM

Is current[0] the pivot piece, or the piece moving about the pivot piece?
Was This Post Helpful? 0
  • +
  • -

#3 Riz 01   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 27-August 09

Re: Rotaion for Puyo Puyo game written in JAVA

Posted 04 December 2009 - 01:35 PM

View Postbsaunders, on 4 Dec, 2009 - 11:31 AM, said:

Is current[0] the pivot piece, or the piece moving about the pivot piece?


Hi bsaunders thanks for the reply, current[0] is the piece moving about the pivot piece
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1