C++ :: How To Make Graphical App / Game
Jan 27, 2014So 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 RepliesSo 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 RepliesI'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)
I'm just playing around with C++ and I'm trying to make a sort of virtual pet game. I know its not the best looking code but I'm trying. But as of right now I'm trying to be able to animate the game a little . For example , if a user decides to "pet" their "pet" I want the pets mouth to open from '_' to ^o^ like this:
() ()
('_') -> () ()
(^o^) and switch back and forth.
Here's my code:
#include <iostream>
#include <cstring>
using namespace std;
void Greeting()
[code]....
How would I make a game map in the console using text? The map is to be changed on a turn-based system. I've been thinking about using arrays.
View 1 Replies View RelatedLets say that I try and make a BASIC game with c++, how do I make the animations/graphics for the game (i.e the characters ) Do I need a specific complier/ide (I am using visual studio)
View 11 Replies View RelatedI wanna know how to do so a cmd window when you open a game.
Example: when I start cheese attack (just a name I like) then a cmd window come up, how do I do that?
How can i create a graphical user interface using c
View 10 Replies View Relatedwhen 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 RelatedSo I've just been messing with enet trying to figure out how to make a server and client for a game. I'm having problems whenever the server receives something from a client. For now I'm just trying to send it to all the clients for them to draw the other player, but for some reason whenever I try to an error message comes up saying a breakpoint has been triggered. I don't know why it is happening. This is the code that is giving me problems.
for (unsigned int i = 0; i < peers.size(); i++)
enet_peer_send(peers[0], 0, event.packet);
I'm digging an old project and i can't switch to a newer visual studio.
I want to plot float data array during debug.
I know some IDE's have such option. There is a separate window in which we can plot data.
Can I write such plugin for Visual Studio 6.0 using visual studio SDK?
Does it support 6.0 version?
I'm working with a game editor program, where the player can create their own maps. Right know I'm working with collisions, and since it's unpredictable where the player place the objects like trees, houses and cars...etc have I an idea with making a rectangle selection tool. Where the player can drag a collision box around the object, so the sprite stops when it hits the box. The problem is that I dont know how to make a tool like that. so my question is how do I create a tool like that (see picture under for more information)?
btw I'm using the SDL framework
here is a picture that illustrate the tool I want to create: [URL] ....
I am starting a turn based battle (similar to pokemon) app. How could i make this and make it cross platform. Also is it possible to make it access gps and allow other devices with the same app communicate with each other?
I have done things on the command line but i never made anything with images so i dont even know where to start for this app.
I recently wrote a "Tic Tac Toe" console game, and i seem to have a problem in my winning conditions, as when it checks if the player won (should have won) it doesn't take the appropriate action.
The winning conditions are in CoreLogic.cpp
here's the code, might not be the most pretty and clean code ever but it works for me.
there are more files i just didn't feel the need to include them all since the problem is only within CoreLogic.cpp and possibly in main.cpp
pos1-pos9 have been declared in the UserInterface.cpp and are being used to determine the correct decision to do within CoreLogic.cpp
Nothing happens when you win at this point it just exits the program.
I have started making a text adventure game.
if (Choice == 2) {
cout << "" << endl << "You follow the light to the end of the hallway, you find your self in a room" << endl
<< "with natural light coming from a hole in the ceiling." << endl << "" << endl << "You hear the door you just came through, slam behind you!" << endl << "" << endl
<< "There are three possible directions." << endl << "" << endl << "Do you:" << endl << "" << endl << "1) Go forward" << endl << "" << endl << "2) Go left" << endl
[Code] .....
Ignore the if (Choice == 2) at the beginning, that's linked to some previous code.
I want to make the player go back to the first bit of text but i'm not sure how to do this if they keep choosing to go back and forth from one location.
I first thought of doing it by just putting the text back in after they have chosen the option, but I can't do this infinite times.
I am trying to make a basic Snake game using the command window and screen refreshes. So far I have a board, snake, food, and no walls. Basically I have it so the snake moves like the traditional snake in the game, when it eats the food once it grows. However when it eats the food a second time the game crashes. I think I have narrowed the issue down to the grow array that I have (below) but I am not sure if the issue could be a result of something else.
Grow Array
cord growArray (cord *p_values, int *size)
{
*size = *size + 1;
cord *p_new_values = new cord[ *size ];
[Code]....
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?
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 RelatedHere'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.
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] ....
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.
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] ....
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 RelatedI 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
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]....
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]....
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