Jump to content

  • Log In with Google      Sign In   
  • Create Account


BambooCatfish

Member Since 28 Jul 2012
Offline Last Active Aug 06 2013 04:28 PM

Topics I've Started

Trying to reinstall OS from Image

31 January 2013 - 01:10 PM

Ok so I have a backup image of my OS (Windows 7) on an extrenal HDD. I have used it multiple times to restore my PC no problem. I tried to do it again and I got an error message saying that "I needed to format the partition before I could reinstall the OS." The only that changed since my last install is I split my HDD into two partitions. It reccomended that I create a system restore CD and boot from that. I did that and I got a error:

 

something like:

"0x40012000100" (thats not it exactly, I am not on my pc to look)

 

I tried looking up the error and got no real leads. Anyone have any insight?

 

Thanks,

Nick


Question about event handling

24 January 2013 - 01:18 PM

Hey I know that "event" may not be the right word for this but I am making a RPG rouge type game and the basic premise I am working with right now is leveling up... The idea is when the player levels up they can select to raise thier HP, Power(attack), or Toughness(defense) by 1 point or take a "perk" instead. One of the perks I have in mind is a Lifelink ability... If you deal damage greater than 0 you gain a portion of that in HP.

 

In my mind I think of it as an "event".... Player dealt damage, any effect that activates when the player deals damage is activated and the code is run. I know events are used for GUI and input. Should I use delagates? I know I could just hard-code switches or if statements but that seems like a poor way of doing it... I have thought of an entity component system but that would requre a massive rewrite of my code and I am not looking to do that right now.

 

How can I implement something like that in a generic modular way where I can have diferent conditions that the perks could react to...(if that makes sense).

 

Thanks,

Nick

 

EDIT: I think I found what I was looking for... creating a system that allows the objects to send messages to eachother when they do things, using a finite state machine. Any other idas are still appreciated!


Question about using "Game States"

05 January 2013 - 09:10 PM

Ok so lets say I have this:

 


enum GameState
{
   load, pause, idle, movePlayer, etc...
}

 

how is a good way to handle being in different states? The only way I know would be to use conditional branches in the update loop. ie:



privave void update()
{
     if (gameState == GameState.something)
              updateGameStateSomething();
     else if (gameState == GameState.somethingElse)
              updateGameStateSomethingElse();
     
     //etc...


}

 

A better way?

 

Thanks

Nick

 

 


Rendering 2D

11 December 2012 - 02:57 PM

Hi,

I have question about rendering in general. I have windows or a HUD if you want... how do I handle telling the renderer to draw the informaiton for each window? should they just draw themselves? I'm not sure how to handle turning window specific information into a form that can be handled in a general sense by the renderer.

Another way of putting it:

I want the window to "tell" the renderer to draw it at a position and then to draw its contents, whatever they may be.

Dont know where to start and I'm just scratching my head thinking about it.

Thanks,
Nick

New to this need some help

17 September 2012 - 09:09 AM

Hi,

I am pretty new to game development. I used to mess with RPG Maker when I was a kid and used the RMXP and VX to write some code and have made a batle system in that so I have some experience I guess. Anyways, I am learning to program games in Java using Slick2D. I have made a Pong clone and am now on to a more adventerous project. It is a side-scrolling space shooter. I have a good start so far I have a player ship that I can move, I have enemies that I can spawn. Collision is working. But I have a few questions.

1) I have a level class that contains all the Arrays that hold my objects. One of the Arrays holds the bullets. Currently I have two different types of weapons the player can use. You start with a machine gun and can upgrade to a plasma missile (Ooooh!). Anywys I am usure of a good way of adding the weapons to the array in a clean manner. Right now each of my weapon types has a create method that will create a weapon of its type at the position of the owner and move in the direction the owner is facing. It seems bad to me to have a object have a create method that crates a copy of itslef.

Here is how it works basically (This is from the update method of my level object):


  if (player.getState() == GameEntity.State.shooting){
  
   try{
	bullets.add(player.createBullet());
   }catch(Exception e){
	System.out.println("Cant make a bullet");
   }
  
  }

and in my player object:

public BaseWeapon createBullet() throws SlickException{
  Vector2f position = this.getPosition();
  int direction = getDirection();

  if (direction == 1){
   return weapon.create(direction,(int)( position.x + bulletOffset.x), (int)(position.y + bulletOffset.y));
  }else{
   return weapon.create(direction, (int)(position.x), (int)(position.y + bulletOffset.y));
  }
}

and finally in my weapon class (this is the machine gun):

public BaseWeapon create(int direction, int x, int y)
   throws SlickException {
  // TODO Auto-generated method stub
  return new MachineGun(direction,x,y);
}

It seems like a bad way of doing it, but I am not sure how to have it determine what wepaon the player has and then create an object of that type and add it to the array other than making a method that returns the type and going through an if statement for each type. That would be a headache.

2.) Hopefully this one will be easier... In my player method I have the left mouse control shooting. All it does is set the state to shooting and the level object checks to see if a object is in the shooting state and then it creates a bullet from the code above. Sometimes if I double click or click quickly it gets stuck in the shooting state and it will fire an endless stream of bullets until I click again can you see why?

   if (input.isMouseButtonDown(Input.MOUSE_LEFT_BUTTON) && getState() != GameEntity.State.overheated){
  
	if(getFire() == 0){
	 System.out.println("Fire!");
	 setFire(getFireRate());
	 increaseHeat(getWeaponHeatRate());
	 setState(GameEntity.State.shooting);
	}else{
	 setState(GameEntity.State.idle);
	 System.out.println("no fire");
	 setFire(getFire() - 1);
	}
   }

If you need/want to see more code I'll glady upload the source.

Thanks for any input

Nick

PARTNERS