Posts
 
Reputation
Joined
Last Seen
Ranked #3K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
4
Posts with Upvotes
3
Upvoting Members
4
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Commented Post
1 Endorsement
Ranked #856
~6K People Reached
Favorite Tags
Member Avatar for crapgarden
Member Avatar for pritaeas
0
118
Member Avatar for crapgarden

[I]FYI - I'm coding in actionscript 3.0 but didn't see an area to post for that language.[/I] I made a simple character and a block. I'm trying to get it so that if the character will touch the box, it wont let him move to imply a wall/collision. I've got …

Member Avatar for mrnutty
0
185
Member Avatar for crapgarden

I have this code: [CODE]#include <iostream> using namespace std; int main() { enum foxtrot {green, yellow, red}; foxtrot colorSelect; cout << red << endl; [COLOR="Red"]cin >> colorSelect;[/COLOR] cout << colorSelect << endl; } [/CODE] Line 10 gives me the result 2 as expected, but line 11 gives me a compile …

Member Avatar for ashishseo
0
205
Member Avatar for crapgarden

This code: [CODE] int array1[5] = {1, 30, 90, 40, 3}; char array2[] = {125, '}'}; cout << array1 << endl; cout << array1[0] << endl; cout << array1[1] << endl; cout << array1[2] << endl; cout << array1[3] << endl; cout << array1[4] << endl; cout << array2 << …

Member Avatar for crapgarden
0
97
Member Avatar for ~s.o.s~

Hello to all Gamedevelopers out there. Many of your have already wanted to get into game development but came to a stand still due to the lack of resources. [B]Please don't post Spam or Thank you posts in this thread since this is meant to be used as a guide …

Member Avatar for Serapth
4
3K
Member Avatar for crapgarden

Can someone explain this excerpt from a book I'm studying: [CODE]char phrase[] = "Game Over!!!";[/CODE] [U]BOOK:[/U] [I]"C-style strings terminate with a character called the null character to signify their end. You can write the null character as ’\0’. I didn’t need to use the null character in the previous code …

Member Avatar for crapgarden
0
186
Member Avatar for crapgarden

This is just a quick question about when calculations are performed in a line of C++. Say I have the following block: [CODE]int numItems = 0; inventory[numItems++] = "sword"; inventory[numItems++] = "armor"; inventory[numItems++] = "shield";[/CODE] the ++ operator increments the array number of inventory AFTER it reaches the ; operator? …

Member Avatar for crapgarden
0
118
Member Avatar for crapgarden

[B]QUESTION 1[/B] In this line of code, I get that it's using the date/time to seed the code for a more random number each time, I'm just wondering what the < > operators are doing? [CODE]srand(static_cast<unsigned int>(time(0))); [/CODE] I realize, they're making time into an unsigned int, but why not …

Member Avatar for pseudorandom21
0
449
Member Avatar for crapgarden

Just to clarify, the text I'm reading defines the lifecycle of a program as: -idea -plan -source code -object file -executable. In gaming terms would this be comparable to: -an Italian plumber goes on an adventure to save a princess from evil turtles and mushrooms. -sketch out level designs. Write …

Member Avatar for jonsca
1
181
Member Avatar for crapgarden

Here's a defined enumeration: enum shipCost {FIGHTER_COST = 25, BOMBER_COST, CRUISER_COST = 50}; Then they do this which I don't understand: shipCost myShipCost = BOMBER_COST; My question is why don't you just do the following instead? int myShipCost = BOMBER_COST;

Member Avatar for crapgarden
0
153
Member Avatar for crapgarden

Is this: A)[CODE]while (!isLegal(move, board))[/CODE] the same thing as: B)[CODE]while (isLegal(move,board) = !!)[/CODE] ?

Member Avatar for crapgarden
0
143
Member Avatar for crapgarden

[COLOR="Red"]4.6 - Insert() vector argument specs. Iter or not?[/COLOR] This allows me to refer to the second spot in a vector named 'inventory': A) [CODE] vector<string>::iterator myIterator; cout << "\nYou found a compass"; inventory.insert((inventory.begin() + 1), "compass"); cout << "\nYour items:\n"; for(iter = inventory.begin(); iter != inventory.end(); ++iter) cout << …

Member Avatar for mike_2000_17
1
143
Member Avatar for crapgarden

In my book, it says find() must be used like so: ex: iter = var.find(scores.begin(), scores.end(), score); but later it uses this in practice: ex: while (used.find(guess) != string::npos) Why can you simply pass 'guess' var to it here and not need to search a range? Isn't find() an algorithm …

Member Avatar for LevyDee
0
104
Member Avatar for crapgarden

Still learning and I just want to be sure I'm clear on a few very basic syntax issues. Any help is much appreciated. [COLOR="red"]5.1 - Basics[/COLOR] int = a single number? char = a single letter OR number? string = a phrase of letters (up to?) char array[]; // array …

Member Avatar for Ancient Dragon
0
232
Member Avatar for crapgarden

I have a question on Chapter 4, exercise 1 of Michael Dawson's "Beginning C++ through Game Programming 2nd Edition". The chapter goes over STL, vectors and iterators. The assignment is to create a program that allows the user to edit games in a list. In the book we learn about …

Member Avatar for mrnutty
0
329
Member Avatar for crapgarden

[COLOR="Red"]3.3 - Objects vs Types: Strings, char, int.[/COLOR] Strings used to be an array of char in C-style coding. Now they're objects in C++. Does this mean that int and char are not objects?

Member Avatar for crapgarden
0
223
Member Avatar for crapgarden

[COLOR="Red"]3.2 - Defining and Differentiating Computation. [] vs ()[/COLOR] I'm trying to get a solid fix on how math computations work in C++ and how to declare their order, in particular with respect to ( ) operators. this adds to an array: [CODE] inventory[numItems++] = "armor".[/CODE] why don't I need …

Member Avatar for crapgarden
0
126
Member Avatar for crapgarden

[COLOR="Red"]3.1 - ARRAY arguments, char vs int.[/COLOR] It seems you pass a char OR an int to a substring of an array. Does it matter which one? ex: [CODE] char charValue = 5; int intValue = 5; string awesomeArray[9] = {"truck", "car", "boat", "table", "ocean", "cat", "board", "finicky"}; //Both of …

Member Avatar for Fbody
0
116
Member Avatar for crapgarden

[COLOR="Red"]5.8 - Function Declaration vs Array Declaration SYNTAX CLARIFICATION[/COLOR] this declares an array: string word2("Over"); string word3(3, '!'); how are these not being mistaken for functions that pass default parameters? Is it because the parameters placed above are not = to anything or being defined as a type? Are the …

Member Avatar for crapgarden
0
172