New programmer has new programmer questions.

Started by
20 comments, last by jyujinkai 18 years, 4 months ago
Well you have a 10 × 10 matrix, pick 25 squares randomly and mark them with a -1, let's call a -1 a mine. then just fill the rest of the matrix so each cell contains the number of mines that are close to that cell (yes this is like a non-playable minesweeper)

(I am gonna use # instead of -1, and a single space instead of 0 for this sample:

-|-|-|-|-|-|-|-|-|-| | | | | | | | | | |-|-|-|-|-|-|-|-|-|-| | |1|1|1| | | | | |-|-|-|-|-|-|-|-|-|-| | |1|#|1| | | | | |-|-|-|-|-|-|-|-|-|-| | |1|1|1| | | | | |-|-|-|-|-|-|-|-|-|-| | | | | |1|1|1| | |-|-|-|-|-|-|-|-|-|-| | | |1|1|2|#|1| | |-|-|-|-|-|-|-|-|-|-| | | |1|#|2|1| | | |-|-|-|-|-|-|-|-|-|-| | | |1|2|3|1|1| | |-|-|-|-|-|-|-|-|-|-| | | |1|#|2|#|1| | |-|-|-|-|-|-|-|-|-|-| | | |1|1|2|1|1| | |-|-|-|-|-|-|-|-|-|-|
------ XYE - A new edition of the classic Kye
Advertisement
Quote:Original post by DarkScript
i need help in collision detection...im currently using the bounding box in directx9...but what i want to do is.....if they collide..i use a better more accurate collision detection method...any help


I don't want to be rude, but please make your own topic. I don't think you will get much help using someone elses topic. If you have trouble with making your own topic, ask how.

To the original poster, if you like games, I recommend you make a small one. Try a text version of pong maybe. Guess the number is good as well. Start small, but apply what you learn. If you just answer little exercises, you might learn some, but applying it works better if you really want to learn to use what you learn. Programming isn't like math class because in math, you prove what you know, but a successful programmer proves by doing/making something, not just showing that he knows what a class in C++ is.


Hi there.... I have worked though the map problem given to me by "M2tM". Thanks... it is pretty hard for my level.. remember I have only been programming for 4 days and learning from a book at the moment : )

Anyway, I have the map gen working almost 100%. Basically it will create the map, and open the pathways but has no way of telling if it has made a legitimet path from entry to exit.. so 1/2 the maps made will be invalid.. the other 1/2 will look fine...

I am sure I have gone about this wrong.. mabey there is a lot I am missing... but I think I will need to read more of my book as I still have about 1/3 of it to go. Still it was a lot of fun working on a problem that had no answer in the book... thanks again. M2tM.

I will now have a go at doing that "build a character / have it fight" idea of "King of Men", then get back into sloggn though the book.

Please download and have a look at my source and the exe. Any comments appreciated.. form errors in code to presentation, to "HINTS" about how to get it working 100%. Please do not just tell me what to do.

Thanks again :)
Random_Map_01.cpp
Random_Map_01.exe


(if those links break at some time in the future.. please look up The Animation Club, you will find the files there)

@Vexorian
I honestly didn't read your post before I posted these results. As you can probably tell due to the fact that the source dosn't reflect your idea. That seams like a good way of doing it though, to have the program select some "key" points and then build spaces around it... but wouldn't that result in having the same map built each time? And if not how would you stop it from making a dud map (like mine dose 1/2 the time)
There is nothing able to be imagined by one man that can not be achieved by many - Jules Verne
It was actually another exercise. but oh well
------ XYE - A new edition of the classic Kye
@Vexorian

oh... sorry I didn't understand you post then.. please explain?

@ghostbear77

Here is the number guessing exersice you talked about. Please download and have a look at my source and the exe. Any comments appreciated.. form errors in code to presentation, etc.
Thanks again :)

Source:
GuessRandomNumber_-_DO.cpp
GuessandomNumber_-_WHILE.cpp
Reverse-GuessNumberGame.cpp

Programs
GuessRandomNumber_-_DO.exe
GuessandomNumber_-_WHILE.exe
Reverse-GuessNumberGame.exe

(if those links break at some time in the future.. please look up The Animation Club, you will find the files there)
There is nothing able to be imagined by one man that can not be achieved by many - Jules Verne
He was describing a version of minesweeper. If you don't have it under "start->programs->accessories->games" check on google and you should be able to download a copy.

It's a good exercise, but you might have more fun with a character stat thing. Like have a character class and be able to set up two characters and make them fight or something like that. It was your idea anyway so I suppose you should implement it however makes sense to you.

I'm really glad you liked the map thing, it's not a really easy problem especially for a beginner. I'm impressed you got something working, I'll take a look when I get home from work.
_______________________"You're using a screwdriver to nail some glue to a ming vase. " -ToohrVyk
yeah, something like that. lol

i didn't mean it as exercises but hints on what you could do. use your imagination, say "i want to make an spaceshooter/rpg/rts." and then begin small. i am at the very beginning myself. having made some little programs, not games yet and nothing graphical.
now i've started a remake of "Omega Race" some old C64-'classic' (well it is for me at least) that something like an asteroid-clone. my first step is to create the graphics ("models"), then movement, controls, shooting, ect. you get it, one part after the other. and its all a learning-by-doing too.
i think its an ok way to do it (for now). like in a team, where everybody does something else (one creates the graphics, another the physics-system, and input, ...). but since you're alone, you are everyone in the team, doing the pieces one by one.

you seem to know 'how' to do it, but not 'what'. maybe you should look for some team, that has an idea and participate? when you finally found your own dream, start to work at it. you'll have learned a lot more until then, working with others on their dream. (and maybe it even becomes yours, who knows.)
< enter some witty programmer's one-liner here >
I do have a "dream" game in mind. One that I hope to have an attempt at in the future. I personally am sick of 3d games that are all based on reflex. FPS boar the tears out of me and most RPGs are so lacking that I spend the time reading a good book. The games I seam to be spending more and more time playing are all what I call "quick fix" games or inivative strategy/puzzle games.

A "quick fix" game is something like Galalga, Pacman, Xevious etc etc. Quick to play, you can control it with out reading a 200 page manual and the play time is quick addictive and satisfying , though still leaving room for you to get back to your life. I've yet to come up with a cool idea to enter into that arena. I have seen some good ones over time but nothing recently.. this one here is pretty cool. Though more "wow, thats cool" than "man I can't stop playing". N

As for the long term game, well It is a little large to chat about in this thread... not that it is huge. It is at its very core a cross between a CCG (collectors Card game) and chess, then to spice it up I might add a little Hero's of Might and Magic into the mix... but early days... still gotta get the hang of simple C++ first :). Who knows how my ideas will change once I understand some of the "how's and why's". Entire gaming ideas may open or close to me as I learn how it all works.

As for teams, I am all for community helping and stuff, not sure how I could help most on this forum apart from making 3D content. (I do 3D VFX for film nad TV) Still I am always ready to help if I can.
There is nothing able to be imagined by one man that can not be achieved by many - Jules Verne
Create a game of guess my number.

Create a map that has (x,y) coords that the user can choose which direction to go, later add things like area descriptions, and enemy encounters. (Textbased game)

Calculate the sum of all 6 digit palindromes.

Create a program to solve towers of hanoi.
- GDKnight
@GDKnight

I already posted a Guess the Number Game... .. . I might be able to do the walk around a map thing if the map was hardwired.... I looked at those math things I wouldn't have the foggyest where to start.
There is nothing able to be imagined by one man that can not be achieved by many - Jules Verne

This topic is closed to new replies.

Advertisement