C++ :: Quiz Game - Playing Video In One Round?

Apr 9, 2014

I am making a game of quiz and i want to play a small clip in one of the rounds, but i dont know how to do it in c++ ....

View 3 Replies


ADVERTISEMENT

C# :: Playing Video Without Windows Media Player?

Mar 26, 2014

I try to play a video I i don't know how.. I searched and i found some tips and articles, but all of it if about Windows Media Player. It's fine, but i need to play something lika an intro an i don't wanna show all that buttons of WMP.. I tried to hide it but no change.

View 2 Replies View Related

Visual C++ :: Playing Video Using Windows Media Player From A Buffer?

Oct 25, 2013

I am developing a VC++ application with windows media player component. play video from a video buffer data which i have?

View 2 Replies View Related

C++ :: Game Loop Design - Restart Round?

Sep 30, 2013

I have a simple game loop.

while(true) {
//round initialization stuff
while(true) {
//capture input, make pieces move,
}
}

I am faced with the decision of what is the best way of restarting the game. The problem is, the condition for restarting a game is very, very deep inside the game's logic. So returning returning... is not an option, or at least, it ain't gonna be pretty.

So one of my considerations is to use a goto label, like so:

while(true) {
//round initialization stuff
while(true) {
//capture input, make pieces move,
} restart_round:
}

This seems to be the cleanest solution, since it allows me to fully reset the 'state' of the round, by first having all the destructors(pertaining to the round's objects) called, and then the constructors and other initialisation stuff.

Are there any subtleties that I am missing regarding this solution?

View 10 Replies View Related

C :: How To Add Timer To Mini Quiz Game

Jun 1, 2014

I want to add a timer to my mini quiz game and show how much time it took for the user to finish it .I want to learn how to do that in C language

NOTE: My program only has a splash screen Allegro

The files are attached :

A bitmap [URL] .....

(I couldn't attach because of the size is above 200 kb. Please save as a BMP file )
A text file
A CPP file

View 9 Replies View Related

C++ :: Saving Progress Of A User In Quiz Game

May 5, 2014

I'm making a quiz game in c++. I've already completed it. But now I've thought of creating a profile and saving the progress for the user so when he enters his name the game continues frm where he had saved it.

View 3 Replies View Related

C/C++ :: Quiz Show Game - Reset File To Original

Apr 7, 2015

I've been taking a C++ class, and for a project we need to do, we have to create a simple quiz show game while putting the high scores and names inside a .txt file. We have lessons we can look at to complete it while learning. But at the end there's always a challenge that we should complete to show that we've actually learned the information. For the challenge, we needed to take the information in the .txt file and reset it to its original information. So say there's 5 people preset that have high scores, then a person plays the game and the program asks if they'd like to reset the list. If the user inputted 'y' or any key that needed to be pressed, the program would reset the .txt to its original information.

This is the code that creates the program.

// Include Libraries
#include <iostream>
#include <string>
#include <fstream>
// Include standard namespace
using namespace std;
// Declare Global Variables
int Guess;
int Winnings;

[Code] ....

It works how I need it to and there aren't any problems, necessarily, but I want to know if there's any, more efficient, ways of completing this task. Like if there's any already made function of resetting a file.

This is the code that resets the file. As you can see, it just uses the information earlier in the code inside the if statement. Is there any pre-made function or method of resetting a file?

cout << "Would you like to reset the high scores list? (y or n): ";
cin >> ask;

if (ask == 'y')
{
High_Score[0] = 25000;
High_Score[1] = 12000;
High_Score[2] = 7500;
High_Score[3] = 4000;
High_Score[4] = 2000;

[Code] .....

View 1 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++ :: Video Game - How To Set Up Save System

May 20, 2013

I would like to create a video game. It would be text based. How could I set up a save system? Also, how would I load it?

View 3 Replies View Related

C++ :: Video Game - Accessing Objects In Another Class?

Dec 3, 2014

I am working on a video game that is based on a tutorial I found online and I ran into an issue associated with accessing an object's method inside another class object's function without making the object global which seems bad.

Here is basically how the tutorial set things up in the game: The game has a base class called GameObject then there are other child classes that inherit from this class. The GameObject class has all the basic information an object would have that needs rendered on the screen (x/y position, size of bitmap, bitmap, whether or not it is collidable, etc).

One of the child classes SpaceShip, which is the player so it has attributes and methods associated with managing # of lives and points scored.

There are other child classes of GameObjects in the game that need to take life and add points from the SpaceShip object if they collide with the spaceship or other objects.

In the collision handling routine I basically call a function "void Collided(int objectID)" when a game object collides with another. Within the Collided() routine, there is logic that executes code or other functions based on the objectID it collided with. Some of the collisions require taking life from the spaceship or adding points. The way this was accomplished in the tutorial was with function pointers (see Bullet class constructor and collided method for example). Is this really the best way to handle this sort of thing? It seems like there has to be a simpler way than to keep referencing function pointers in any new class I want to add to the game. I realized this when I went to add a method for the spaceship to fire bullets rather than inside my game class.

My Project Source found here: [URL] .....

View 5 Replies View Related

C++ :: Video Game Programming - How To Display Graphics And Set Properties

Jun 10, 2013

How would you create a video game in c++? I'm not sure really how to display the graphics and set properties and do all that stuff. I don't have money to buy a book about so how do you?

View 2 Replies View Related

C++ :: Video Game - Compare 3 Players Score And Output Highest

Oct 21, 2013

I was tasked with creating a program that asks for the scores of three gamers then takes these scores and outputs the highest. I THINK I have the other parts down but I don't know how to get the program to compare the scores and output the highest without having to write a long list of commands comparing playerone to playertwo, then player one to playerthree, then player two to playerone, etc.

#include <iostream>
using namespace std;
int main () {
int playerOne, playerTwo, playerThree;
cout << "Please enter score for Player One: ";
cin >> playerOne;

[Code] .....

View 10 Replies View Related

C :: Round Up To Or Round Off To The Nearest Cent?

Nov 19, 2013

how I would easily round a double or a float to the nearest cent. It was easy enough to do it in visual basic or java, But i cannot figure out how to do it in C.

View 6 Replies View Related

C :: Round Off Float To Integer

Mar 10, 2013

I have a float values I'd like to round off to the nearest integer value.

That is to say, if the float value is 44.234533, the integer value should be 44. If the float value is 44.682101, the integer value should be 45.

How do I do this?

View 4 Replies View Related

C :: How To Truncate And Round A Decimal

Jan 14, 2014

To one decimal place?

Code:

#include <stdio.h>
int main() {
double num, trunc, round;
printf("
Enter a Decimal:
}

[code]...

That's my code currently, I've gotten it to round as I want, but I want it to truncate to one decimal place as well.If i enter 4.157, It should truncate to 4.1, and round to 4.2.

View 1 Replies View Related

C/C++ :: FLTK - Creating Box With Round Corners

May 8, 2014

The problem says: Draw a box with rounded corners. Define a class Box, consisting of four lines and four arcs. So I wrote the below code for that exercise:

#include <Simple_window.h>
Simple_window win(Point(100,100), 600,400, "semi-ellipse");
struct Box: Shape{
Box(Point p, int ww, int hh): w(ww), h(hh)
{ add(Point(p.x-ww,p.y-hh)); }

[Code] ....

When I ran it I faced this exception:

Unhandled exception at 0x757FE9D7 (ole32.dll) in test.exe: 0xC0000005: Access violation reading location 0x00000004.

I know this refers to declaring "Simple_window win(Point(100,100), 600,400, "semi-ellipse");" in global state. But I did that because I had to do it. The problem is that how to attach lines and also object (here b) to Simple_window win in either parts (main() function and also Box struct).

View 13 Replies View Related

C++ :: Do While Loop Skips Over Input The Second Time Round

Mar 4, 2014

I don't understand why my Do While loop skips over the input the second time round?

#include <iostream>
#include <cstring>
#include <cstdlib>
#include <string>
using namespace std;
//prototype
string reverseInput(string *);

[Code] ....

View 2 Replies View Related

C/C++ :: Time Gaps In Round Robin Scheduling?

Mar 26, 2015

I've recently completed a fully functional round robin algorithm for a class, however upon running a myriad of test cases I found where mine fails. I think it best to show with an example:

Process-Burst-Arrival
P1 1 0
P2 1 1
P3 1 4
P4 3 8
P5 5 20

Currently what happens is this, it runs perfectly from process 1 through process 3. However once it reaches process 4 it does the appropriate thing and adjusts my total processing time (q variable) to the arrival time of process 4. Great! But then, it rolls over to check the queue again and it's bringing in process 5, changing q to it's arrival time. Then it proceeds to swap them in and out due to them both now being in the queue and time quantums/slices running out.

My question is this: How/where do I put a lock on the while loop that runs the simulated scheduler (round robin in this instance) to not grab the next process when there's a time gap in between each process.

This specifically is the two lines that I can't seem to get working as they should:

if(arrival[i]>q)
q=arrival[i];

FULL CODE BELOW

#include <iostream>
using namespace std;
void RR(int n, int burst[], int arrival[], int throughput)
{

[Code].....

View 14 Replies View Related

C++ :: Music Not Playing SDL

Jan 24, 2013

The music that I want to plays not run :( Theoretically all arguments are well, but I don't understand why not works.

if(Mix_OpenAudio(22050, MIX_DEFAULT_FORMAT, 2, 4096) < 0) {
cout << "Error inesperado";
return 0;
}
Mix_Init(0);
Mix_Music *musica = NULL;
musica = Mix_LoadMUS("pixeluniverse.wav");
if (!Mix_PlayMusic(musica, -1)) {
cout << "Error inesperado";
}
...

View 12 Replies View Related

C++ :: Playing Audio File?

Jan 5, 2013

i have a audio file that i want to play via C+.

View 4 Replies View Related

C# :: Drag And Drop Quiz

May 13, 2014

What I'm looking for is actually a few things. I want to creat a drag and drop like quiz. For example:

-You get 4 pictureboxes with 4 different pictures of pc components (the solutions). Below that there are 4 other empty pictureboxes to drag the picture to with text aside from them (the questions).Now How would I go about linking the different pictures to the correct text ? I already have drag and drop working, but the linking is killing me.

View 1 Replies View Related

C/C++ :: Audio Playing With Irrklang?

Apr 4, 2014

I tried playing audio using irrKlang in openGL.But i ended up with some problems.

I have attach my source file and also my output file here.

View 2 Replies View Related

C++ :: API For Playing Sounds On Console Application

Aug 8, 2013

I'm thinking of making a horror text-based game, which would use sounds, if you could also tell me of an API to display images in an alternate window that would be nice.

View 6 Replies View Related

C :: Math Quiz Program - Multiplication Function

Nov 16, 2014

Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void correctResponse(void);
void incorrectResponse (void);
void multiplication( void ); // function prototype

[Code] ....

// end function multiplication

// It keeps crashing. How do I compile the responses into a grade?

View 5 Replies View Related

C/C++ :: CodeBlocks Random Math Quiz Generator

Nov 26, 2014

The user will be allowed to pick:

-the number of problems they want to do
-the type of problem (addition, subtraction, multiplication, division)
-the range of numbers for the problems (like 0 to 9, -100 to 100, etc.) [random numbers in the range]

Your program will then display the given number of problems and get the answer from the user. It will tell the user it they are correct or not. If they are incorrect, it will print the correct answer.

After the given number of problems are displayed, the program will give the user the final number correct and percentage correct. The user will be asked if they want to go again. If so, you will reprompt the user for all the information and run again.

I came up with code thinking I was going in the right direction but it doesn't work correctly at all. We have to use functions. My main issue is how do i call variables from another function so all of the functions work together. I repeat I don't understand parameters and calling functions. here's the code:

#include <iostream>
#include <cstdlib>
#include <iomanip>
using namespace std;
int get_user_range(int &x, int &y);
int get_random_number ();

[Code]......

View 1 Replies View Related

Visual C++ :: Cannot Get The Sound To Stop Playing CDA File

Apr 26, 2013

I can not get the sound to stop playing a cda file with MCI_CLOSE. This code works with wav and mpg and avi files.

LONG WindowProc() {
switch (msg) {
case WM_COMMAND:
if (wParam == IDC_PLAY) {
//A CDA File
SendMessage(m_hwMCI,MCIWNDM_OPENA,0,(LPARAM)&chFile);

[Code] .....

View 1 Replies View Related







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