Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 16 Jun 2012
Offline Last Active May 03 2016 06:56 AM

Posts I've Made

In Topic: Making an in game shop?

24 July 2015 - 08:26 PM

Here's some questions to help understand what your needs are:
1) Is the game text-based, 2D, or 3D?
2) As far as the player's equipment goes:
A) Does the player have a list of all Buckets he owns?
B) Does the player only "have" the latest/best bucket he's purchased?
C) Is the player's buckets mingled in a single inventory with all his other equipment?
3) After getting a new boat, is there any reason why you'd want to switch back to a previous boat?


1) It is a 2D game. The items that the player has will have instant effect as there will be no place to hold the items. I could make it so the player can visit the store to swap out previously bought items for no cost.

2,A) He will not have a list as bucket upgrades are direct and provide no trade off, so there would be no reason to switch to an older one.

2,B) He will have the latest bucket he purchased.

2,C) The bucket is not in any inventory. The inventory is meant to hold just caught fish.

3) I am currently unsure if there will be a point of switching, but I'm going to say there will be no reason to downgrade as new boats will always be direct upgrades. 


Also I'm starting to understand the idea behind having different classes that hold the item's data. I actually think I was somewhat starting to develop that when I was first trying to make the store.

In Topic: Making an in game shop?

24 July 2015 - 02:55 PM

Thank you guys so much for the help! As what Servant of the Lord said about my question, we kinda did get a little off topic. But I guess I also forgot the original question after  reading some of the replies. Since I do not know how many items I plan on selling, it seems best that I fully plan that out first. 
I really like the idea of breaking things down into parts as suggested by switfcoder:

Behold, one non-polymorphic boat, and a set of input handlers:
interface PlayerInput {
  void processInput(Boat boat);
class TapInput extends PlayerInput { // use for rowboat
  void processInput(Boat boat) {
     if (keyPressed && !lastKeyPressed) {
class HoldInput extends PlayerInput { // used for powerboat
  void processInput(Boat boat) {
     if (keyPressed) {
final class Boat {
  PlayerInput mPlayerInput;
  int speed;
  int position;
  void moveForward() {
    position += speed * deltaTime;

But I'm just a little unsure how this works. Like if it was buying an item from a store switching from tap to hold, what would be executed once it was bought?

Also @Servant_of_the_Lord

I am planning on having multiple stores, but I do not understand your second example that well. 

For example, I am not sure what this means because I'm not familiar with the language.

struct Hook { /* etc... */ };
struct Rod { /* etc... */ };
struct Propeller { /* etc... */ };
struct FishingNet { /* etc... */ };
struct Bucket { /* etc... */ };

And how the shop code works. Could you please explain it a little more?

In Topic: Making an in game shop?

23 July 2015 - 11:50 AM

Thank you Onigiri Flash for the illustrations, they really helped! I like both ideas, but Onigiri's seems more practical in my case because controlling the boat might change. For example, I'm going to have a row boat that requires a constant press to keep moving and speed boat that can move by holding a button.


But I might do both if I'm going to have many boats in different subclasses. 

In Topic: Making an in game shop?

23 July 2015 - 10:55 AM

Thanks for the reply! Wow I haven't thought about polymorphism in a while, I think I'm going to need to refresh myself on it.


I use java, but I don't really understand your example that well. Are StarterBoat and MegaBoat two objects that extend the class boat?

In Topic: Making a simple drawing game in browser?

22 April 2015 - 03:43 PM

Just a quick question, if I were to create the drawing app for html5 will it work for mobile devices? When searching online for tutorials, the examples wouldn't work for my tablet.