Sign in to follow this  

My First Game + High Score name input question

This topic is 4860 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all. I've finished my first game using DX9 and C++ (for the most part), and besides letting you have a look at it for comments, I also needed some help with one of my remaining issues. I need a way to ask the user for their name at the end of a game in the event they got a high score. Right now, the high score system will read and write from the .txt file just fine, but when it writes, it just uses "Eric" as the new name for now because I couldn't think of a way to input names. Are there any general subwindows that DirectX can use for something like this inside my main window? As for the game itself, if you decide to download it and take a look, I realize the game isn't very effecient at all, taking up ~70% resources on my computer when running, so it's something I'll have to pay very close attention to on my second game. Sorry about that ahead of time. :) My Game: http://www.s95447599.onlinehome.us/13277.html

Share this post


Link to post
Share on other sites
As has been said many times before (i'm almost certain i've seen it on this board several times) when writing the game you don't worry about optimization of the code, that generally comes later after you get it working, and rewrite sections to optimize the bottlenecks, like the simple bingo game i wrote once, hogged resources like nobodies business. Then i was lookin at another bingo game written in a different language, and discovered that while i was using many if statements the and 5 arrays, it could be done much more efficiently with 1 multi-dimensional array, and a few for loops. These are all things that come with practice and experience. Also, it might be an idea to include the source for the high score system, so that those that offer suggestions aren't suggesting something you've already implemented.

Share this post


Link to post
Share on other sites
Read the article for input in Allegro on the front page of the site. The general algorithm doesn't need much changing for different APIs. I recently created a rather robust class for input for the NeHeGL basecode, and this code helped me to implement all the necessary features rather quickly. It should give you some ideas.

Share this post


Link to post
Share on other sites
For my first Tetris game I just had a big switch statement for the input. Basically I just did a normal input command, checked which key was pressed, then concatinated it onto the my Name string. It wasn't very pretty, but it did the trick. I'm sure there's an easier way to do it though, like perhaps using a windows popup window to get the name, but I'm not sure how to code that.

Share this post


Link to post
Share on other sites
^^Ah crap. :( The first person who really tries to play my game, and it craps out. I had checked my program on 4 computers in this house, ranging from current ones to one made in 1996 or so I think. In every case, if the game didn't work, all the computer needed was to install the DX9.0c runtime. Not that I'm a pro at debugging, but what was the exact message you got from the game? I want to see what DX function initializer your computer wasn't able to perform to see if maybe my code is too specific. The only thing I can think to say right now is that if you play from the ZIP file, it may be a little screwy as opposed to unzipping all the files to a folder, and then playing from the folder. I'll try to look into it. Can anyone play it though? :(

As for everyone's replies, thank you for them. I appreciate the comments on user input. I'll make sure to read the input article on the front page.

EDIT: Thanks for the Bingo exmaple. It makes me feel a little better at least. :)

Share this post


Link to post
Share on other sites
I think I understand what you mean, Thunder_Hawk. These days it seems like if you're playing a game, you are expected to give up all your CPU and general computer power to the game. What else are you really doing anyway? :) And to that extent I agree.

But I suppose what I really meant is if I had been a programmer for Doom III or HL2, you'd all have to wait another 20 years for hardware to catch up to my system reqs. :) In general, I just need to work at writing more efficient algorithms and design things more efficiently. I still appreciate any comments on trends in the industry that people know though. So keep them coming.

Share this post


Link to post
Share on other sites
very nice, especially for a first game...I really like the music...and the graphics are all shiny and nice...I don't really have many comments except...excellent!

EDIT: btw, where did that music come from? just curious, 'cause it's cool music...

[Edited by - NewbJ on August 22, 2004 12:40:20 AM]

Share this post


Link to post
Share on other sites
Thanks for the kind comments NewbJ. As a note to anyone downloading it, I re-uploaded the files without a .MID that my game doesn't use, but it turned out that even though it doesn't use it in game, it still attempted to load it. Therefore... I just revereted the whole thing back to the original. So if you've downloaded it recently and gets errors about initializing things, but the game still works, it's just becuase you're missing a .MID the game was trying to load.

EDIT: The main music is by Ayla, and it's called "Karawane". It wasn't mentioned in my initial ReadMe file when I first uploaded the game, but it has since been put in.

[Edited by - The Pikmin Chef on August 22, 2004 4:21:37 AM]

Share this post


Link to post
Share on other sites
I tried to run it and I got this error :(

Unhandled exception at 0x005aafb4 in Sirtet.exe: 0xC0000005: Access violation writing location 0x00000000.

I have the DX9c SDK installed, so that is not wrong

Share this post


Link to post
Share on other sites

This topic is 4860 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this