Jump to content

  • Log In with Google      Sign In   
  • Create Account


Crusable

Member Since 27 Nov 2011
Offline Last Active Apr 26 2014 08:57 PM

#5108732 std::vector memory leak issues

Posted by Crusable on 12 November 2013 - 11:26 AM

Thank you everyone. I figured out the error was with my singleton, it wasn't deleting properly. Thanks for the help.




#5099396 Java Image problem

Posted by Crusable on 07 October 2013 - 03:15 PM

Thanks for the response. 




#5093484 Tile Map Editor/Collision Detection

Posted by Crusable on 11 September 2013 - 11:36 PM

The way I do my tiles is to have a struct with a few values: position, size, texture, and solidity. Solidity is a bool and is set when I read in an xml file. When I check for collision, I check to see if the tile the entity is about to go onto is solid, if so, then I set the entities position to the edge of the tile and offset it by one pixel. I don`t know why people do layers I have never used them. When I render all the textures, I make sure I render the map and then entities, and then any UI. I see that you are reading in an image and then iterating through each pixel and based on the pixel you set the tiles. A way you could do this when you find a pixel, for example that matches stone, set that tile to a stone tile and then it gets all the properties. The way you are doing it with the one image doesn't look like you can do collision detection because you need the positions of the tiles and such. I hope this helped.




#5081090 Where Do I Start? So Many Possibilities

Posted by Crusable on 27 July 2013 - 06:42 PM

Java is fine for a beginner and in lots of cases a good idea if you are a beginner. For making games, I would start with the basics, pong, breakout, space invaders, ect. If you jump right into a big game without learning the basics then you most likely will not finish. As for making games, you can use different libraries such as slick, which I have used and it works great, but I am not sure if it is still being supported. There is an sfml bind to java, but I have not used it. You can make a game using straight java if you want. Also, when you do finish a game, I recommend getting some people to look it over and see if you are in the right direction.




#5069330 C++ SDL switch not working properly

Posted by Crusable on 13 June 2013 - 01:29 AM

You have CLip[i].y twice, not sure if that is your problem but you should fix that.




#5046422 Create enemies in 2D side-scroller

Posted by Crusable on 24 March 2013 - 09:53 PM

Also,  you could do a "Gauntlet, Dark Legacy" style where there are spawners that you can destroy. As long as the spawner is alive and you are near it, then enemies will spawn. 




#5039549 Game development: list of books

Posted by Crusable on 05 March 2013 - 10:26 AM

If you already know c++ I wouldent reccomend beginning c++ through game programming. That book is for beginners. Thats allI got.


#5022042 Which visual Studios 2012 do i need?

Posted by Crusable on 15 January 2013 - 09:45 PM

Thanks :)




#5020840 for loop that will repeat the number of times the user wants.

Posted by Crusable on 12 January 2013 - 02:44 PM


where the while loops will take a couple

 

Remember C/C++ and as far as I know Java too, don't use line endings a seperators.

You can happily write your whole application in one line, as long as the compiler supports it and you don't miss any semicolons.

 I understand his, however i said this because the only time i put more than one  "line" of code on one line, is in simple switch statements,

 

 
switch(choice){
 
     case 1: /*goto function*/ break;
 
     ...
}
 

 

and in the code that other people write, i have never seen more that one "line" of code on a  single line. And if you where to write a whole application on one line, it would be very confusing, unless it was a hello world program.




#5020618 for loop that will repeat the number of times the user wants.

Posted by Crusable on 12 January 2013 - 02:23 AM

The code for the for loop will be the same but here:

 

 

 
//imported crap and other code
 
Scanner scan = new Scanner(System.in);
 
int numLoops;
 
System.out.print("How many loops?");
numLoops = scan.nextInt();
 
for(int i = 0; i < numLoops; ++i){
       
//do whatever you need to and loop as many times as the user entered for numLoops
}
 

 

 

you can do the same thing with a while loop (or do while), but the for loop has everything working in one line, where the while loops will take a couple.

 

Hope this helps smile.png




#5014956 Whats wrong with my Collision function?

Posted by Crusable on 27 December 2012 - 09:17 PM

void Move(){
	
	//Check if there is collision
	if(!(box.x >= SCREEN_W) && box.y >= SCREEN_H) {

		xDir = '+';
		yDir = '-';
	}

	if(!(box.y >= SCREEN_H) && box.x >= SCREEN_W) {

		xDir = '-';
		yDir = '+';
	}

	if(!(box.x <= 0) && box.y <= 0){

		xDir = '-';
		yDir = '+';
	}

	if(!(box.y <= 0) && box.x <= 0){

		xDir = '-';
		yDir = '+';
	}

	//Move
	if(xDir == '+'){

		box.x++;
	}

	else if(xDir == '-'){

		box.x--;
	}

	if(yDir =='+'){

		box.y++;
	}

	else if(yDir == '-'){

		box.y--;
	}

}

 

This is supposed to make a square bounce around the window. The first time it hits the bottom it works, then it goes right through.




#5001983 Impotant! Books to start learning video game programming ! I need it...

Posted by Crusable on 18 November 2012 - 02:31 AM

Im not sure if this was said already but a good book, that i personally learned c++ from, is called beginning c++ through game development. Its cheap and very easy to understand. And when it says through game development, its using simple text games as examples for learning c++. As many will say to stay away from c++ if you are just learning how to program since it is complicated, i say go for it. I learned c++ first, and it was challenging, and i don't recommend it, but it can be done.

http://www.amazon.ca/Beginning-Through-Game-Programming-Second/dp/1598633600/ref=sr_1_2?ie=UTF8&amp;qid=1353226851&amp;sr=8-2

Also, there is c++11 out, and i haven't looked into it, and i really don't want to right now, but maybe you should look for something that explains that. Now don't quote me on anything, but c++11 is the new version of c++ and people will probably start moving towards that.


#4992717 2D Game art help

Posted by Crusable on 22 October 2012 - 04:21 AM

If photoshop is too complicated for you, you should check out gimp or paint.net. Gimp is a bit more complicated, but they are both very helpful, and easy to use tools that i have used. If you are using mac, i cannot help you, but for Windows or Linux (well Ubuntu anyways), gimp works on both, and as far as i know, paint.net only works on windows without wine or some other program to run windows programs. And they are both free.


#4923091 Beta Testers Needed

Posted by Crusable on 18 March 2012 - 01:32 PM

by saying independant multiplayer you are saying something like guild wars.. sorry for the confussion.
and if ur like wtf its like TF2 i havent played that game.


#4912839 Linux help

Posted by Crusable on 13 February 2012 - 08:12 PM

Hello everyone

I have resently downloaded linux. I cant actually get code::blocks to eork. I have downloaded all the crap for it and still cant seem to get it to work.

Thanks for any help :)




PARTNERS