« Happy Hacking in 2010 ! | Main | Android - Placing random game configurations - part 2 »

Android - Placing random game configurations - part 3

Now that I realized that there has to be more than one random tree just to start with, I had to be sure that there is a way to dynamically find out where the trees are placed. Visually anyone can draw multiple trees on a bounded area, but programmatic-ally it requires some thoughts. This is an area I need to improve in the implementation, but for now it looks fairly nice. So essentially I will be leaving this at that, and will comeback later. 

Next thing to tackle is to remove tree edges, when an user cut an edge. Ah, this is familiar problem in graph algorithm, we just need to find the connected component, and drop the component that does not have the root. As it turned out, BFS (breadth first search) table becomes very handy. Also that cutting any internal edge of a tree makes it to two trees.

 Now I can have multiple trees on the canvas. I can start the play, so when I cut an edge of my choice, it takes the connected component without the root down. I never said that one or both connected component could be empty set of edges:).

Next in line is when an user tries to cut an edge, we need to know what edge it was. I plugged in some simple geometric primitives to do just that, otherwise I would never be able to cut that edge and the related connected component it generated. But the problem is one has to hit several time to get the right (x, y) coordinate of the pixel, yeah a very good way to hurt your eyes!. 

Since the line widths are very small when I go for single pixel thickness, I have to have it parameterized to dynamically adjust from the device capability. For now, I can test for 5 to 10 pixels worth of thickness. And right there, I come across another geometric problem!. How do I compute on the rectangle that is just formed, so that user will click once to cut an edge and its associated non-rooted component? That is my next design. Interestingly these little mathematical and algorithmic problems makes me think!.  For example, rectangle is a convex shape, so given a point I need to decide if it is inside the convex region or not!!

 In summary -

  • I've been able to connect the host to the openmoko.
  • I've the debug environment set.
  • I've the user's side of playing
  • I will get to the game evaluation and game engine part soon!

 

 

Posted on Saturday, October 17, 2009 at 07:29AM by Registered CommenterProkash Sinha | CommentsPost a Comment | References2 References

References (2)

References allow you to track sources for this article, as well as articles that were written in response to this article.
  • Response
    Yes’s I will be agree with your point of view. After the launching of android mobile platform the gaming world have been changed. Now the people who are playing the games on their systems now more of them converting on mobile phones games.
  • Response
    Response: best essay
    Journal and articles of the literature and all such conditions are embraced and floated. It is the resurrected and induced with he right and proposed. It is the rendered and anticipated form of the success and triumph.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.