C++ :: Game Editor - How To Make A Rectangle Selection Tool

Dec 20, 2014

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] ....

View 4 Replies


ADVERTISEMENT

C++ :: Simple Rectangle - How To Make It Move Using Data Structures

Feb 27, 2014

So I made a code that shows a simple rectangle. How do I make it move using data structures? :)

Code:
#include "Glut_Setup.h"
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <time.h>
using namespace std;

float P1= -5;
float P2= 2;

[Code] .....

View 2 Replies View Related

C++ :: Send Rectangle To A Function Which Takes A Rectangle Argument

May 13, 2014

Consider I have a rectangle like this:

Point p1(100,100);
Point p2(300,200);
Graph_lib::Rectangle r(p1,p2);

And also I have a function that takes a rectangle and returns a Point of that, say, top-left corner of that rectangle. For example:

Point N(Graph_lib::Rectangle R1);

My question is that, first, how to send that Rectangle r(p1,p2) to the Point N(Graph_lib::Rectangle R1) function? And then, how to return a Point from that function?

My IDE is visual studio 2012.

View 19 Replies View Related

C++ :: Selection Process Using Roulette Wheel Selection?

Feb 9, 2013

I'm trying to make a selection process using roulette wheel selection. To do this I created two matrix, one random probabilities and one increasing probabilities. The idea is to choose a number according to the random probabilities. Here is the code I've written.

#include <iostream>
#include <conio.h>
#include <cstdlib>
using namespace std;
int main (){
float select [5], prob [10], mat [5];
int c, r, z;
cout.precision (2);
cout << "Random Number:" << endl;

[Code]...

The result I got is as follows:

Random Number:

0.0013 0.56 0.19 0.81 0.59

Increasing Probabilities:

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Selected Column:
0
5
6
8
9

The evaluation doesnt seem to start from c=0 again. The selected column should be 0, 5, 1, 8, 5.

View 6 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++ :: 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++ :: Make A Sort Of Virtual Pet Game

Dec 29, 2014

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]....

View 5 Replies View Related

C++ :: How To Make A Game Map In Console Using Text

Oct 25, 2014

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 Related

C++ :: Make Animations / Graphics For Game

May 27, 2014

Lets 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 Related

C++ :: How To Make CMD Window Pop Up When Open A Game

Dec 20, 2014

I 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?

View 1 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++ :: Enet - How To Make Server And Client For A Game

Feb 1, 2014

So 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);

View 2 Replies View Related

C++ :: Turn Based Game - How To Make It Cross Platform

Sep 12, 2014

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.

View 4 Replies View Related

C++ :: Tic Tac Toe Console Game - If Statement Does Not Make Correct Decision

Feb 18, 2015

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.

View 19 Replies View Related

C++ :: Text Game - How To Make Player Go Back To Previous Location

Mar 19, 2013

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.

View 5 Replies View Related

C/C++ :: Make Basic Snake Game Using Command Window And Screen Refreshes?

Apr 15, 2015

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]....

View 7 Replies View Related

C# :: Simple Map Editor In Winforms

Mar 20, 2014

I want to create a simple map editor in winforms. I would like for it to use a tile sheet from the user which they then can click on tiles from it and place it on the specified grid. Then export this as a binary file. Or perhaps it would be easier for the user to chose the grid size then have each grid space's number be able to be changed like 01,02,03 to represent an image. Then export this as a binary.

View 1 Replies View Related

C Sharp :: UI Type Editor In WPF?

Jun 13, 2012

I'm working on WPF project and There is this problem with property grid control. Here I saw the similar problem solved in windowsform project. how I can accomplish this behavior on WPF.

View 1 Replies View Related

C# :: Add Line Numbers To A Text Editor

Jun 7, 2012

I'm trying to add line numbers to a text editor I'm building but not having much luck. I'm trying to find a way around building something massive with a picture box next to my textbox etc. I'm tried adding VS Basic to my references and searching for the linenum_rtf.cs but I can't seem to find it under existing items.

View 4 Replies View Related

C++ :: Text Editor Printing Algorithms?

Mar 26, 2013

They should apply for: backspace, return, regular char input, vertical scrolling. There is only one buffer, and it is not allowed to side scroll past max col, instead it must scroll down, appending the line cur_y + 1.

View 4 Replies View Related

C/C++ :: How To Write Plugins For Text Editor

Nov 21, 2013

I want to add plugins like line numbering, syntax highlighting,code coloring,text alignment in a text editor. How i start including them?

View 1 Replies View Related

Visual C++ :: Making A Text Editor

Oct 24, 2013

when making a text editor do you have to create a parser for it or are parsers just used in compilers and interpreters?

View 6 Replies View Related

C++ :: Find And Replace Function For Text Editor

Jan 3, 2013

I'm building a find and replace function for my text editor I'm building the function without support from the algorithm header.

The function is written like: doc.find_replace("Word_to_be_replaced", "The_word_that_is_replacing"); I find this very easy to understand replace this, with this.

find_replace will both have char * as their arguments.

The problem I'm having right now if I replace a bigger word for a smaller word how do I delete the extra characters from memory.

So if I replace "Goodbye" with "Hello" how do I delete the last two characters? So I don't print garbage code.

View 1 Replies View Related

C/C++ :: Linked List To Simulate Text Editor

Mar 10, 2015

I am trying to make a text editor in C++ that uses Linked Lists as the main driving force. I need to make a program that can add a line of text at a certain point, delete a certain line of text, print the entire text, and quit and save the text to the original text file inputted from the shell script. My problems are with the cpp file, and the linked list files. My remove function is not what I need it to be I know that. I also know that there are some problems with my cpp file myEditor. My code is below.

#include <sstream>
#include "linkylist.h"
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
using namespace std;
int main(int argc, char *argv[]) {
//node* head = new node;

[Code] ....

View 6 Replies View Related

Visual C++ :: Resource Editor Failed To Initialize ActiveX

Feb 27, 2014

I'm working on a project which consists of several ocx loaded by one exe. The platform is WinCE. Now I'm on a process to create a new ocx. I do have a copy of those ocx projects in Win32 platform. These Win32 versions were only used to register ocx in local system and then put those on to application dialog by 'Insert ActiveX'.

Now the problem is those Win32 projects are so outdated, and unable to build. Getting too many linking errors to be solved.

I have build the new ocx and link that with exe manually by editing .rc file and all. But still no luck. New ocx is getting registered in WinCE device but failing to start application.

View 6 Replies View Related

Visual C++ :: Doubly Linked List And Basic Text Editor

Sep 23, 2014

I'm supposed to make a basic text editor using a doubly linked list, I have pretty much written most of it but keep coming across several problems. In certain places,all marked in the code, I get the error "expected a declaration" ive looked online and nothing ive found works. And secondly I also get the error" declaration has no storage class or type specifier" but i havent been able to find anything that works either.

Code:
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <assert.h>
#include <string>

[Code] ....

View 6 Replies View Related







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