C++ :: How To Set If Health 0 Game End

Mar 10, 2014

How i can set if health 0 game end?

#include <Windows.h>
#include <iostream>
#include <BluetoothAPIs.h>
#include <ws2bth.h>
bool Move(int xadj, int yadj);

void LoadMap();
void DrawScreen();

[Code] ....

View 3 Replies


ADVERTISEMENT

C/C++ :: How To Accumulate Reduction In Health Points In The Loop

Feb 22, 2014

How to accumulate the reduction in health points in the loop. I have structured my program so it calls to 2 functions during the loop. These are the playerStrike() and computerStrike(). They seem to be looping well with the one exception that the counters reset back to 100 health points each time. I know it's reloading the original variable amount but how to prevent it from doing this.

#include <iostream>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <cstdlib>
using namespace std;
//function prototypes
void playerStrike();
void computerStrike();

[Code] ...

View 3 Replies View Related

C++ :: Determine Health Of A Power Transformer - Graphic User Interface?

Nov 27, 2014

I have a program I want to write that determines the health of a power transformer. I know the syntax of all the other code I might have to use but I'm not too sure of how to make it fit into a graphic interface like you see in any other windows program.

View 1 Replies View Related

C++ :: Game Design Practice For Accessing Container Of Game Objects

Dec 21, 2014

I'm working on my first video game. So far I have a few classes in the game starting with the Game class which includes a list of GameObjects (another class). There are several classes that inherit from GameObjects used to implement things like bullets, explosions, various enemy types, etc.

The game essentially iterates through the list of GameObjects to update/render them. I would like to provide access to the Game's list of GameObjects inside another class (like the Bullet class) so I can put new objects on the list. For example, when a bullet hits, I want to add an explosion to the Game's GameObject list it can be updated/rendered.

How this should be setup? I was considering adding a pointer to the Game or GameObject list to the GameObject class (and methods to access it), but I was wondering if there is a better way to set this up?

View 4 Replies View Related

C++ :: Program For Calculating Total Price Of Game Station And Game

Sep 13, 2014

I would like to make a program for calculating the total price of a game station, and a game. I made a program like this for just the price of a game in class, but I want to make one that does the game system as well.

View 7 Replies View Related

C++ :: Making A Game With GUI

Feb 27, 2015

Here's my game, what do I need to learn to make a basic GUI? (Easiest way possible for now).

--NOTE, the code was a bit too long for me to post. I can add it if it is necessary. Basically all I want are 4 buttons on the main screen, one that says "Arena," "Store," "Stats," and "Exit."

There will of course be sub menus to each option, but we will get to that later.

View 1 Replies View Related

C# :: Three And Four Player Uno Game

Feb 26, 2015

I'm having some problems figuring out 3 and 4 player games in an Uno game I'm working on. I'm not sure what specifically the problem is, however. I've tried everything I can think of; I'm at a loss for what to do next. Two player games work perfectly, which makes the nonfunctional 3 and 4 player games seem odd to me. Here is the code:

public void MoveOpponents() {
if (nextPlayer == 0) {
if (Main.dir == Direction.Clockwise) nextPlayer = 1;
else nextPlayer = numPlayers - 1;

[Code] .....

The code for the human player is in Update(), but I won't show that because it's actually quite similar to the above code.

Right now what it's doing is jumping all over the place, making opponent 2 play before opponent 1, then I play, then opponent 1 plays. Then I play again. It's really messed up.

View 6 Replies View Related

C++ :: Tic Tac Toe Game With Multidimensional Array

Jan 13, 2015

Problems :

1) Is there any way so that i can use "X" and "O" char instead of 9 and 0 int.?? I also tried to use enum but was only able to print out -1 for 'X' and 0 for 'O'...

2) if player - 1 choose field 2 . and player - 2 chooses field 2 .. how can i show error and ask for another input ?

3) is there any short coding trick for int check_result(); ?

Code:
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;

[Code] ....

View 3 Replies View Related

C :: Can't Determine Tie Status Of The Game

Nov 12, 2014

I've made an effort for three days to write this code. But, my brain has stopped now. I wrote code to find the status of the game (win, loss or tie). However, I can't determine the tie status of the game. Tie status is the problem

View 5 Replies View Related

C :: Save And Load Game

Nov 26, 2013

I am trying to put my Save and Load function in my game, this is what i have:

Code:
/* Save game */
void GuardarJuego() {
FILE *fsave;
char turno;
fsave=fopen("SAVE.txt", "w");
fputs(*****, fsave);

[Code] .....

My game code is this: [C] GameCode - Pastebin.com

View 8 Replies View Related

C :: How To Continue Minesweeper Game

Oct 24, 2013

I am just now in my first programming class for learning C language and I am stuck on one of my homework assignments. I am not asking you to write the code for me or anything because I want to learn by doing it myself but all I am asking for is some pointers to where I am messing up. My program is already finished for what she asked for but I am trying to do an extra credit where she wants us to have the user decide how big the gameboard is and how many mines to hide in it. Really I know that I need to use srand() and rand() but I am not sure how to use them to randomly place mines and without placing mines on top of others.

Code:

//Program 3 "Minesweeper" by Casey Samuelson
//10-17-2013
//This program will imitate the game Minesweeper.
//Agorithum

[Code]....

View 4 Replies View Related

C :: Correct Answer Does Not End Game

Feb 21, 2013

Okay so I thought I had this assignment completed properly last week. Last night I found a bug while playing the game.why won't the game end when the player guesses the correct number? The game allows you to finish using the max number of guesses even though you already guessed the correct number.

Code:

#define _CRT_SECURE_NO_DEPRECATE
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#define MAXGUESSES 6
#define MAXGAMES 20
#define MAXNUMBER 100
}

[code]....

View 9 Replies View Related

C++ :: If And Else Statements With Game Scores

Oct 20, 2014

I am in comp. Sci 1 at my school and I have to write a program that deals with gamer scores and the trophy they get according to expert level. For example Tom is a beginner and gets a gold medal if >=10000 a silver >= 7500 bronze if >= 5000 and no trophy if he score <5000 ! I have do this scoring for Beginner, Immediate and Expert.

Should I set up the beginning like this:

case'b':
case 'B':
if (score >= 10000 )
trophy= gold
if (score >= 7500)
trophy = silver
if (score >= 5000)
trophy= bronze
else = none

Not really sure how to go about solving this problem

View 4 Replies View Related

C++ :: Adding Inventory Into Game

Sep 2, 2014

I am making a text based rpg for school and im having troubles with it. Ineed to add an inventory into my game and im not to sure as to where or how.. this is what i got for player

#ifndef PLAYER_H
#define PLAYER_H
//console Util.h includes <iostream> , <string> and <window.h> and defines
//the NOMINMAX macro. As a result of including ConsoleUtil.h, PLayer will
// also knaow about thoes objects.
#include "ConsoleUtil.h"

[Code] ...

View 2 Replies View Related

C++ :: How To Make Game Available To Be Played On LAN

Jul 1, 2014

I'm making a simple single-player game. Now, assume I've made the game, how would I go about making it available to play on LAN? (I'm not really bothered about making it playable across the world with people not on the same wi-fi)

So, any way that I could get started or any libraries/APIs ....

I'm using Windows 8.1 and I'd like my game to be playable on other Windows OSs (7 and Vista if possible)

View 3 Replies View Related

C++ :: Possible To Put Video In Game Using Allegro 5

Apr 5, 2014

is is possible to put a video in your c++ game using allegro 5?before starting the game................

View 1 Replies View Related

C++ :: Creating Game Using SFML

Apr 26, 2014

I'm currently working on a 2D space shooter game in C++ using SFML library. What I need to know is how make an object (ex:laser) fire up from object (ex:player) when a user press button??

View 1 Replies View Related

C++ :: Realization Of Lee Algorithm In Game

Nov 19, 2013

I wont search realization of Lee algorithm in Game(2d turn-Based Strategy 20 x 30 cells),need AI on C++ ???

View 1 Replies View Related

C++ :: How To Use Regex Library To Use It In CLI Game

Jan 18, 2015

I want to use C++ regex library, to use it in my lil' CLI game. The aim is to create the template(not C++ template :)) for command(like "go north"). Then, if player writes anything that contains "go", and "north" appearing after that(examples: "go north" "please go north" "Let's go north!" "Princess, I insist that we go to the north") would all be interpreted as simple "go north". I have used a bit of regex in Linux system, but not this ECMAScript regex that C++ uses.I've checked in some online regex tester, that if I write: ".*go.*north.*" then anything I want will be matched; however, I'd like these to be specifically separated by space(the rule is: between north and go there must be at least one character: a space, so that gornorth won't be interpreted as command.).

Bonus points: if it's possible to do that without some kind of black magic, I'd like to achieve following goals:

1)Before go, there can be any amount of characters, but if there is 1 or more characters, the character just before go must be space.
2)In between go and north, there must be at least one character, space. If there are more, then characters right after go and just before north have to be spaces.

View 8 Replies View Related

C++ :: How To Start Writing Game App

Oct 23, 2013

How do i start writing Gaming app using C++. What is the environment required. I have mingw compiler installed on Windows8.

View 4 Replies View Related

C++ :: How To Make Graphical App / Game

Jan 27, 2014

So far I only made console and windows form apps but how do I make something like a 2D game with drawn objects and not a text-based program?

View 1 Replies View Related

C++ :: BlackJack Game - How To Keep Score

Nov 20, 2014

A buddy and I have been working together to try and create a blackjack game for a project we are doing, and while we have a couple of issues we are trying to get worked out, for some reason we are perplexed as to how we can keep score. Right now, it keeps score but it doesn't reset when it adds a card. So if you had 14 and you hit, and added 3; you would have 31 instead of 17.

// initialize players and hands
srand(static_cast<unsigned int>(time(0)));
GetPlayerInfo(players);
do {
int score = 0;
bool busted = (score > 21);
ShuffledDeck(deck);

[Code] .....

View 2 Replies View Related

C++ :: Guessing Game With Numbers Between 1 And 100

Apr 22, 2014

I neeed to Create a guessing game with numbers between 1 and 100. The loop will never exit until the condition is met. The user will continually guess and display:

Sorry Too Low
Sorry Too High
You Guessed Right

** YOU MUST USE THE BOOLEAN VARIABLE… when the boolean is true, the loop will exit **

This is what i got so far;

#include <iostream>
using namespace std;
int main() {
//Declaring Variables
int guess=50,x;

[Code] .....

View 2 Replies View Related

C++ :: Port A Pc Game To Android

Jul 10, 2013

How do I port a pc game to android? Do I just include libraries or do I have to rewrite all my code?

View 5 Replies View Related

C++ :: Space Shooter Game In SDL

Apr 25, 2013

I'm really new to SDL and i've been trying to make a spaceshooter game, so far I've got a ship you can move around in using the arrow key (square shaped) and a scrolling background. I'm up to making my ship fire bullets at the moment and it's really not working, i've finished lazy foo's tutorials on SDL and there's nothing on this.

Here's my code

#include "SDL.h"
#include "SDL_image.h"
#include "SDL_mixer.h"
#include "SDL_ttf.h"
#include <string>
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;

[Code] .....

View 19 Replies View Related

C/C++ :: Factor Game Using Loop

Feb 12, 2015

So I'm doing this problem where the user will input a number that will be factored until the number is 1, 2 people will play this game and they will take turns entering a number that the initial number(named gameN) will be divided by until it is 1. Whoever get it to 1 wins. My problem is I'm not really sure how to do this, I'm pretty new to programming so besides some if statements and a loop, the problem shouldn't require too much to write. Some rules for the game are, the number entered to factor the gameN cant be less than 2, and has to divide evenly into gameN, which I have signifies with modulus. Here is where I'm at so far.

#include <stdio.h>
int main(){
int gameN;
int p1f;
int p2f;
printf("What number should the game be played with?");
scanf("%d", &gameN);

[Code] ....

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved