C++ :: Making Arrays For Equipping Weapons In Simple RPG Game

Feb 26, 2014

I have a sword(25 damage), spear(20 damage), arrow(15 damage), dagger(10 damage) and knife(5 damage). I want to make a class for them so that I can equip one of them in battle and use them to inflict damage.

View 1 Replies


ADVERTISEMENT

C++ ::  Making Simple Game In SMFL - Player Class Does Not Have Type

Jul 20, 2013

I'm trying to make a very simple game in SFML, and i have a problem. Whenever i try to create sf::Sprite for the class where all properties of Player (his sprite, health, speed, etc.) It gives me error.

#include <sfml.h>
#include <list>
class Playerclass{
public:
int xspeed, yspeed;
float health;
sf::Sprite entsprite();

[Code] ....

The error is with player.entsprite.setTexture(texture) : "'player.Playerclass::entsprite' does not have class type".

View 2 Replies View Related

C/C++ :: Making A Simple Animation

Sep 20, 2014

I wish to create a simple animation, similar to the pong game but completely automatic (i.e. both sides play against eachother sort of like in a screensaver of sorts).

I am clueless on to even start tackling this, what tools to use and how to use them, to make them do what I want. I have had some experience with C++ scripting while modding Fallout 3, but I'm not sure how similar the scripting system available in the SDK for that game, is to the real thing.

Like I was saying I want to create a simple animation where two AI blocks try to prevent a ball from reaching the wall behind them.

View 3 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++ :: Making Open World RPG Game?

Jun 6, 2014

I am making an open world RPG game. I have already done the graphics rendering (with directx 11 on windows 8). I am a bit confused of how to load all of this data in, and I looked into how the game Skyrim did it. I didn't find much information about it at all, apart from it uses cells for each bit of the game, and if you character were to kick a pumpkin (for example) it would record the new location in the player's save file. The same goes for spells, perks, quests, etc.

My problem is, I'm not sure how to implement something similar in code!

View 4 Replies View Related

C++ :: Making A Space Game Using SFML 2.0?

Sep 14, 2013

i am making a space game using sfml 2.0. i want it to move depending on its rotation. so if it is rotated 20 degrees it move in the direction it is facing. how do you do it?

View 17 Replies View Related

C++ :: Making / Building 3D Game Engines

Jan 23, 2013

Making/Building 3D Game Engines, Do I need to know anything related to ART or graphics in order to make them ? I mean, I do know that having a know how about vectors is VERY important, But I am no good at art, I suck. I have thought of getting a separate guy to do the art, as I'm more interested in writing code and then implementing it making use of the art that has been made, I'm just worried if I need to or not need to know anything about sketching or art in order to write a 3D Game engine ?

View 8 Replies View Related

C :: Make A Simple Letter Guessing Game?

Oct 2, 2013

when it comes to programming. I was trying to make a simple letter guessing game where the user has 6 chances to guess the letter V. The command prompt works fine until the user enters 'y' to play. It repeats my HIGH & LOW statements twice before letting me guess again. It's all a mess.

View 2 Replies View Related

C++ :: Simple ASCII Game - Fractal Terrain

Jan 31, 2013

I've been in the process of making a simple ascii game and worked out to make random terrain that wasn't all that bad (but has some flaws and is not very efficient). I came across midpoint displacement and the diamond square algorithms and was blown away by the results that come from using them. So I decided to try implementing one into my game but I'm having a really hard time coding it out. I have read a whole bunch on them but haven't really found any good tutorials that breaks it down into steps with sample code. I just need it stored in an array I can handle graphics and output.

ex: 5x5 array with all starting corners being 9 in height

98679
87658
76557
88789
98889

^^Something simple like that.

View 1 Replies View Related

C/C++ :: Making Tic Tac Toe Without Arrays?

Nov 13, 2014

I am trying to get this to work without arrays. At the moment all I am trying to do is allow it so that when the user presses 1 the board prints with 1 replaced by X, tell me where am i going wrong. I know its not finished.

#include <stdio.h>
#include <stdbool.h>
char a = '1';
char b = '2';
char c = '3';

[code]....

View 3 Replies View Related

C/C++ :: Simple Arkanoid Game - Deleting Instance Of A Class

Mar 24, 2015

I am making a simple arkanoid game. When the ball hits the block, i want the block to disappear. How would i go around this? i am working in visual studio. I got the collision and everything working.. Here is my code;

int main(int argc, char** argv){

//initialisation
SDL_Init(SDL_INIT_EVERYTHING);
SDL_WM_SetCaption("Graphics Window",NULL); //set name of project

//variable declaration
SDL_Surface*screen;
boolrunning;
intgameState;
float startTime;

[Code] ....

View 1 Replies View Related

C/C++ :: Trying To Draw A Grid In A Square For Simple Checkers Game

Oct 7, 2014

I am trying to draw a grid for checkers. I could draw a square at the starting point from origin with the code below(attached the pic below how it looks) however I am not being able to draw a grid when the program runs.

#include "ccc_win.h"
// GameDemo.cpp
// Shows how to place a piece accurately on a grid after a mouse click.
#include "ccc_win.h" // for graphics classes and functions
using namespace std;
int ccc_win_main(void) // main function for graphics program

[Code] ....

View 3 Replies View Related

C/C++ :: Queue Making Using Arrays

Nov 11, 2014

I'm trying to write a code that proves a queue like fifo (first in first out). I have four characters :

p(rint),e(nqueue),d(equeue) and q(uit).

The problem is when I press d a first character must get rid of, but not. When I press d the numbers get double.

Example input:
e 2 3 9 8 7
p
2 3 9 8 7
d
p
3 9 8 7
d
p
9 8 7

#include <stdio.h>
void enqueue(int queue[], int newnum, int *tail_p, int maxsize);
void deque(int queue[], int *tail_p, int *elem);
void printqueue(int queue[],int count);

[Code] ....

View 1 Replies View Related

C :: How To Edit Printed Array Board For Simple Candy Crush Game

Oct 24, 2013

I am required to create a simple candy crush game.

I am this stage where I am required to print the 'box' for navigation purpose at the center of the board once the program initializes.

Here is the code:

Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
//FUNCTION: Draw the Board

[Code].....

I understand that the sequence could be to clear the screen and print the whole board with the indicated marker.

*Yes I am required to move the box in later part of the program but for now, I just need to get the box to show up at coordinate

Code: board[5][5]

I am stuck ...

View 11 Replies View Related

C++ :: Simple Game Menu - Program That Simulates Handheld Gaming System

Sep 26, 2013

I have to write a program that simulates a handheld gaming system. a system can have power toggled so its either on or off. when the system is on, its volume level can be raised or lowerd. a system has minimum volume level of zero and a maximum volume level of 10. a system stores games.

// simple game menu
//simulates a handheld gaming system
using namespace std;
class Game {
public:
Game(int GameNumber = 3, int volume = 10);

[Code] .....

View 1 Replies View Related

C# :: Snake Game Using 2D Arrays

Jun 1, 2014

I'm trying to make a simple snake game in C# using 2 Dimensional Arrays . I have a grid of labels. I am having problems with differentiating the head of the snake from the rest of it's body. Also I need generating 2 random numbers and filling them inside my array.

I don't know how to place random food on my array. This is because the food can't be placed on the location of the snake. Which brings me to my other problem which is keeping track of the snake and updating it. I don't know what structure to use and How to actually do the above methods. I've tried looking at a lot of sample snake projects but they don't have arrays in them.

View 14 Replies View Related

C++ :: Tic Tac Toe Game - Applying OOP And Arrays

Sep 25, 2012

Objective : Code a game allowing two human players to play tictactoe.

Create 2 classes:
-Create a 3 x 3, 2-D array board class to play the game.
-Player; has a private string name data member and a method that reads the players’ row and column selections from the keyboard.

Create 2 player objects from this class. Name the players Orestes and Xerxes.

Think carefully about board and player classes responsibilities and how they interaction with one another. The players do not collaborate with one another but they collaborate with the board.

My Problem : The program compiles with the header file, but it the displaying is wrong as you will see when you enter your row and column.

Sources
Header file:

Code:
#include <iostream>
#include <string>
using namespace std;
class Board {
public:
void display(char Z[][3], int row, int col);

[Code] ....

View 1 Replies View Related

C++ :: Saving Huge Arrays For Game?

Nov 3, 2013

I have been coding a while on a 2D random terrain game. How would I go about saving the maps? I have an array for blocks, lighting, background and background lighting. The lighting is done in real-time, so exclude that.

But with two 32000x3200 arrays, I still need to store 204800000 separate numbers in a file. Oh god. How can I have this? I could write down the separate numbers, but...yeah.

If it matters, this is made in freeglut.

View 2 Replies View Related

C :: Creating Match-3 (Candy Crush) Game Using Arrays

Mar 6, 2015

I'm supposed to create a "game" that is similar to Candy Crush or Bejeweled. The assignment takes in a .txt file that contains a matrix of values from 1-5 and then assigns each value to a spot in a [10][10] array. Then an Escape Code function prints out colored pixels in place of the number values for each spot, creating a "game board" looking output. Finally, the program is supposed to look for any matches of 3 same-colored pixels and replace them with a white pixel and "XX". Then the program prints the corrected game board with the matches X'd out.

I have it mostly coded, but I've encountered a couple of issues.

1.) I am supposed to label the columns and rows 0-9, and while I have no problem coding the labels for the columns using printf( ), when I try to print the row labels I get a random string of numbers.

2.) I replaced the matches with white pixels by reassigning the value in the array to 7, for which the ANSI Escape Code is white. However, I'm unsure about how to print the "XX" in the same spot.

Here is the input(.txt) file and the output of the program so far:

And here is what I have coded at this point:

Code:
#include <stdio.h>
void printEscapeCode(int c);
int main(void)
{
/* Declare an image array to be gameboard */
int gameboard[10][10];
/* Declare variables and load in how many rows and columns */
int Nrows;
Nrows = 0;

[code]....

View 2 Replies View Related

C/C++ :: Madd Libs Game - How To Store Inputted Strings Or Values To Arrays

Nov 11, 2014

My assignment is writing Madd Libs game. I still do not understand how to store inputted strings or values to arrays. I need explanation of collecting inputted data to arrays.

#include "stdafx.h"
#include<stdio.h>
//#include<string.h>
int main(void) {
char string[37] = {''};
char adjective1[15];

[Code] ....

View 14 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++ :: Using Arrays As Sources Of Data For Arrays In A Structure?

Feb 6, 2014

I define "Comwords" as a string, but apparently it takes the members as chars, then I can't set strings in a structure equal to the chars.

I see to also be having unknown problems with the ComMAL array and loading it values into another element of the same structure.

How to correct this? I was thinking of casting char elements as strings, but could find no reference in my library book regarding how to do that (lots on casting int's a doubles...)

Code:

int _tmain(int argc, _TCHAR* argv[]) {
int comm = 10;
int targ = 5;
int death;
struct AI_WORDS

[Code]....

View 2 Replies View Related

C :: Assigning Values To Arrays / Printing Arrays

Jul 1, 2014

Using a for loop, construct two 100 element arrays, x and y, such that element i of x stores the value sin(2*pi*i/100)) and the corresponding element of y stores cos((2*pi*i/100)). Print the values stored in the elements of x and y as you calculate them.

I have attempted to solve it but I'm not sure why the value 0 is only being printed, maybe I haven't assigned sin(2i/100)) and cos((2i/100)) to the arrays properly?

Code:
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main () {

[Code] .....

View 3 Replies View Related

C++ :: Making DLL Of EXE Project

May 28, 2013

I have project that is on c++. it runs fine. i want to use it in my C# application as a dll. i have created its dll and but firing exception of "interprocess communication".

Is this a doable task that creating dll of an exe project and using it in C# application?

View 1 Replies View Related

C++ :: Error While Making DLL

Dec 17, 2013

So I tried to find some youtube videos on how to make a DLL, I found one, I also found several topics (like on msdn and stuff), but I have this code

header

#include <WinSock2.h>
#include <WS2tcpip.h>
#include <Windows.h>
#include <string>
using namespace std;

#pragma comment(lib, "ws2_32.lib")

[Code] ....

And I'm getting these errors:

1>error LNK2001: unresolved external symbol "private: static char * PathSocket::cBuffer" (?cBuffer@PathSocket@@0PADA)
error LNK2001: unresolved external symbol "private: static unsigned int * PathSocket::socket" (?socket@PathSocket@@0PAIA)
error LNK2001: unresolved external symbol "private: static void * PathSocket::hIDTask" (?hIDTask@PathSocket@@0PAXA)

WHY is there static, and what does dllimport/dllexport does? also there are NO tutorials with variables inside dll >.<

I've been following this [URL] ..... and the video I already lost, however there's no

#ifdef MATHFUNCSDLL_EXPORTS
#define MATHFUNCSDLL_API __declspec(dllexport)
#else
#define MATHFUNCSDLL_API __declspec(dllimport)
#endif

in the video, why do we have to use that? [URL] .....

View 19 Replies View Related







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