• Create Account

### #ActualTehOwn

Posted 14 February 2012 - 07:59 PM

Lets break down what you're asking for.
• User must stop when they hit a wall
For this, you need to learn about Collision Detection. This literally means, "Detecting when an object collides with another" and usually involves some action which occurs when there is a collision (bouncing off, stopping, exploding, etc) There are many simple ways to do this, especially in Tile/Grid-based games. One of the simplest ways of doing this is what I used for collision in my PacMan clone.

When you first create games, your player will simply have an X position and a Y position. In a tile-based game, you can use this to detect the player's position in relation to the tiles and the grid on which they lie. Imagine that your player lies on a chess board, if the squares on the board are 64 pixels wide and long, then if your player was at (32,32) then he'd be considered to be in the top-left square. If he was at (500,500), he'd be in the bottom-right square.

Now, each tile in your game must be considered passable or not-passable. Grass would usually be passable, but Walls would not. This allows you to define which tiles players CAN and CANNOT walk on.

With this information together, you can work out which grid-space the player is attempting to enter and check if it is passable or not. If it is not passable, prevent the player from entering that space, but position them so they are immediately outside it.

That is the theory. Hopefully someone can provide you with useful articles to help you implement it yourself.

Secondly:
• Directional bullet firing
For this, you need to create objects that will move depending on a velocity. This is updated every frame and you can also do collision checks on the bullets to detect if they hit anything (like a wall or player).

These concepts are explained quite simply here:
http://www.rodedev.c...ls/gamephysics/

Thirdly:
• Mouse input
Depending on which engine or API you are using; getting and using mouse-input can have a varied level of difficulty. What are you using?

p.s. Hopefully my explanations were easy to follow. Giving advice to others is quite a new thing for me.

### #5TehOwn

Posted 14 February 2012 - 07:59 PM

Lets break down what you're asking for.
• User must stop when they hit a wall
For this, you need to learn about Collision Detection. This literally means, "Detecting when an object collides with another" and usually involves some action which occurs when there is a collision (bouncing off, stopping, exploding, etc) There are many simple ways to do this, especially in Tile/Grid-based games. One of the simplest ways of doing this is what I used for collision in my PacMan clone.

When you first create games, your player will simply have an X position and a Y position. In a tile-based game, you can use this to detect the player's position in relation to the tiles and the grid on which they lie. Imagine that your player lies on a chess board, if the squares on the board are 64 pixels wide and long, then if your player was at (32,32) then he'd be considered to be in the top-left square. If he was at (500,500), he'd be in the bottom-right square.

Now, each tile in your game must be considered passable or not-passable. Grass would usually be passable, but Walls would not. This allows you to define which tiles players CAN and CANNOT walk on.

With this information together, you can work out which grid-space the player is attempting to enter and check if it is passable or not. If it is not passable, prevent the player from entering that space, but position them so they are immediately outside it.

That is the theory. Hopefully someone can provide you with useful articles to help you implement it yourself.

Secondly:
• Directional bullet firing
For this, you need to create objects that will move depending on a velocity. This is updated every frame and you can also do collision checks on the bullets to detect if they hit anything (like a wall or player).

These concepts are explained quite simply here:
http://www.rodedev.c...ls/gamephysics/

Thirdly:
• Mouse input
Depending on which engine or API you are using; getting and using mouse-input can have a varied level of difficulty. What are you using?

p.s. Hopefully my explanations were easy to follow. Giving advice to others is quite a new thing for me.

### #4TehOwn

Posted 14 February 2012 - 07:59 PM

Lets break down what you're asking for.
• User must stop when they hit a wall
For this, you need to learn about Collision Detection. This literally means, "Detecting when an object collides with another" and usually involves some action which occurs when there is a collision (bouncing off, stopping, exploding, etc) There are many simple ways to do this, especially in Tile/Grid-based games. One of the simplest ways of doing this is what I used for collision in my PacMan clone.

When you first create games, your player will simply have an X position and a Y position. In a tile-based game, you can use this to detect the player's position in relation to the tiles and the grid on which they lie. Imagine that your player lies on a chess board, if the squares on the board are 64 pixels wide and long, then if your player was at (32,32) then he'd be considered to be in the top-left square. If he was at (500,500), he'd be in the bottom-right square.

Now, each tile in your game must be considered passable or not-passable. Grass would usually be passable, but Walls would not. This allows you to define which tiles players CAN and CANNOT walk on.

With this information together, you can work out which grid-space the player is attempting to enter and check if it is passable or not. If it is not passable, prevent the player from entering that space, but position them so they are immediately outside it.

That is the theory. Hopefully someone can provide you with useful articles to help you implement it yourself.

Secondly:
• Directional bullet firing
For this, you need to create objects that will move depending on a velocity. This is updated every frame and you can also do collision checks on the bullets to detect if they hit anything (like a wall or player).

These concepts are explained quite simply here:
http://www.rodedev.c...ls/gamephysics/

Thirdly:
• Mouse input
Depending on what engine or API you are using; getting and using mouse-input can have a varied level of difficulty. What are you using?

p.s. Hopefully my explanations were easy to follow. Giving advice to others is quite a new thing for me.

### #3TehOwn

Posted 14 February 2012 - 07:58 PM

Lets break down what you're asking for.
• User must stop when they hit a wall
For this, you need to learn about Collision Detection. This literally means, "Detecting when an object collides with another" and usually involves some action which occurs when there is a collision (bouncing off, stopping, exploding, etc) There are many simple ways to do this, especially in Tile/Grid-based games. One of the simplest ways of doing this is what I used for collision in my PacMan clone.

When you first create games, your player will simply have an X position and a Y position. In a tile-based game, you can use this to detect the player's position in relation to the tiles and the grid on which they lie. Imagine that your player lies on a chess board, if the squares on the board are 64 pixels wide and long, then if your player was at (32,32) then he'd be considered to be in the top-left square. If he was at (500,500), he'd be in the bottom-right square.

Now, each tile in your game must be considered passable or not-passable. Grass would usually be passable, but Walls would not. This allows you to define which tiles players CAN and CANNOT walk on.

With this information together, you can work out which grid-space the player is attempting to enter and check if it is passable or not. If it is not passable, prevent the player from entering that space, but position them so they are immediately outside it.

That is the theory. Hopefully someone can provide you with useful articles to help you implement it yourself.

Secondly:
• Directional bullet firing
For this, you need to create objects that will move depending on a velocity. This is updated every frame and you can also do collision checks on the bullets to detect if they hit anything (like a wall or player).

These concepts are explained quite simply here:
http://www.rodedev.c...ls/gamephysics/

Thirdly:
• Mouse input
Depending on what engine or API you are using getting and using mouse-input can have a varied level of difficulty. What are you using?

p.s. Hopefully my explanations were easy to follow. Giving advice to others is quite a new thing for me.

### #2TehOwn

Posted 14 February 2012 - 07:58 PM

Lets break down what you're asking for.
• User must stop when they hit a wall
For this, you need to learn about Collision Detection. This literally means, "Detecting when an object collides with another" and usually involves some action which occurs when there is a collision (bouncing off, stopping, exploding, etc) There are many simple ways to do this, especially in Tile/Grid-based games. One of the simplest ways of doing this is what I used for collision in my PacMan clone.

When you first create games, your player will simply have an X position and a Y position. In a tile-based game, you can use this to detect the player's position in relation to the tiles and the grid on which they lie. Imagine that your player lies on a chess board, if the squares on the board are 64 pixels wide and long, then if your player was at (32,32) then he'd be considered to be in the top-left square. If he was at (500,500), he'd be in the bottom-right square.

Now, each tile in your game must be considered passable or not-passable. Grass would usually be passable, but Walls would not. This allows you to define which tiles players CAN and CANNOT walk on.

With this information together, you can work out which grid-space the player is attempting to enter and check if it is passable or not. If it is not passable, prevent the player from entering that space, but position them so they are immediately outside it.

That is the theory. Hopefully someone can provide you with useful articles to help you implement it yourself.

Secondly:
• Directional bullet firing
For this, you need to create objects that will move depending on a velocity. This is updated every frame and you can also do collision checks on the bullets to detect if they hit anything (like a wall or player).

These concepts are explained quite simply here:
http://www.rodedev.c...ls/gamephysics/

Thirdly:
• Mouse input
Depending on what language/engine/API you are using getting and using mouse-input can have a varied level of difficulty. What are you using?

p.s. Hopefully my explanations were easy to follow. Giving advice to others is quite a new thing for me.

### #1TehOwn

Posted 14 February 2012 - 07:57 PM

Lets break down what you're asking for.
• User must stop when they hit a wall
For this, you need to learn about Collision Detection. This literally means, "Detecting when an object collides with another" and usually involves some action which occurs when there is a collision (bouncing off, stopping, exploding, etc) There are many simple ways to do this, especially in Tile/Grid-based games. One of the simplest ways of doing this is what I used for collision in my PacMan clone.

When you first create games, your player will simply have an X position and a Y position. In a tile-based game, you can use this to detect the player's position in relation to the tiles and the grid on which they lie. Imagine that your player lies on a chess board, if the squares on the board are 64 pixels wide and long, then if your player was at (32,32) then he'd be considered to be in the top-left square. If he was at (500,500), he'd be in the bottom-right square.

Now, each tile in your game must be considered passable or not-passable. Grass would usually be passable, but Walls would not. This allows you to define which tiles players CAN and CANNOT walk on.

With this information together, you can work out which grid-space the player is attempting to enter and check if it is passable or not. If it is not passable, prevent the player from entering that space, but position them so they are immediately outside it.

That is the theory. Hopefully someone can provide you with useful articles to help you implement it yourself.

Secondly:
• Directional bullet firing
For this, you need to create objects that will move depending on a velocity. This is updated every frame and you can also do collision checks on the bullets to detect if they hit anything (like a wall or player).

These concepts are explained quite simply here:
http://www.rodedev.com/tutorials/gamephysics/

Thirdly:
• Mouse input
Depending on what language/engine/API you are using getting and using mouse-input can have a varied level of difficulty. What are you using?

PARTNERS