Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Brand New to DBPro

Author
Message
xCirusX
17
Years of Service
User Offline
Joined: 24th Jan 2007
Location: 42
Posted: 30th Apr 2007 12:06
Ok, I just started doing DBPro projects. I realize that most of the stuff in here is a little over my head at the moment.

I'm trying to make a Hangman game and need a little help!

After I try to compile this code, it says 'Could not close nest at line...' I've been having a lot of problems trying to get the text spacing part to work correctly...

Any help would be greatly appreciated!

Thanks!



I know it's not complete, and I really need help trying to get the spacing to work... I think I might need to add a variable some where, that way I can increase the text placement by 50 (ie 'text 300,370,a$' I would need to increase 300 by 50 to make it fit)
xCirusX
17
Years of Service
User Offline
Joined: 24th Jan 2007
Location: 42
Posted: 30th Apr 2007 12:42
Ok, disregard the first post (It won't let me edit my post)
I got the 'nest' problem fixed, now I just have a few more questions...



I know it's not complete, I just need some help trying to get the some things to work... I also can't get the letters to show up, but I think I know what I did wrong.

Also, is there a way that only lowercase and uppercase letters can be used? And it will take both uppercase and lowercase as correct?

Any help would be greatly appreciated!

Thanks!

Sorry for being n00bish
xCirusX
17
Years of Service
User Offline
Joined: 24th Jan 2007
Location: 42
Posted: 30th Apr 2007 12:59
Ok, I just started doing a few DBPro projects. I realize that most of the stuff in here is a little over my head at the moment.

I\'m trying to make a Hangman game and need a little help!
I need to figure out a way that if a user enters a letter in any case, it will be correct. Also, if possible, I need to get a way that only letters can be inputed.



I also realize that when you enter a letter in, it does not show up... I\'m working on fixing that right now.

Any help would be greatly appreciated!

Thanks!
Veron
17
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 30th Apr 2007 13:03 Edited at: 30th Apr 2007 13:05
Add an extra ENDIF command at line 55, so your code would be:



May I say, that's fairly good for your first program!


Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 30th Apr 2007 13:10
ooppps...i was just modifying it this way



nevermind
xCirusX
17
Years of Service
User Offline
Joined: 24th Jan 2007
Location: 42
Posted: 30th Apr 2007 13:27
Wow... sorry for the triple post... it isn't letting me edit my post since I'm new... Anyways

Thanks for the quick replies!

Here is my updated code:


Now I'm just trying to make it so only letters can be inputed, and will be accepted as either uppercase and lowercase.

Any suggestions?
xCirusX
17
Years of Service
User Offline
Joined: 24th Jan 2007
Location: 42
Posted: 30th Apr 2007 14:19
Hmmm... I still have to wait forever to post!!! LOL... Hopefully this won't last too much longer.

Here is the updated code... again:


And, I added a cheat function!


Sorry for the awkwardly long period between posting!
xCirusX
17
Years of Service
User Offline
Joined: 24th Jan 2007
Location: 42
Posted: 30th Apr 2007 16:20
I'm still having trouble getting the letters that are inputed to even show up! I've tried everything I could think of so far and still nothing... If anyone could throw a pointer my way that would be great.

Also, I'm stuck when it comes to letters (in any case) to be inputed... I prolly need to add a few lines of code somewhere, but I haven't the slightest on where they should go.

Thanks again!

--------------------------------------------------------------------
Quote: "
May I say, that's fairly good for your first program! "


Thanks Veron
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 30th Apr 2007 17:28 Edited at: 30th Apr 2007 17:29
As you would expect, this subject has been covered extensively before, so all you need to do is use the search option at the bottom of each board.

Not only is it quicker for you to get the answers you need, it saves us typing the same answers over and over and over again.

Typing 'Hangman' into the search on just one board gives the links to the following threads (amongst others):

http://forum.thegamecreators.com/?m=forum_view&t=58731&b=7

http://forum.thegamecreators.com/?m=forum_view&t=62649&b=7

http://forum.thegamecreators.com/?m=forum_view&t=67225&b=7

http://forum.thegamecreators.com/?m=forum_view&t=70014&b=7

http://forum.thegamecreators.com/?m=forum_view&t=94401&b=7

If you are then still stuck on something then by all means come back, ask and we'll try and help.

TDK_Man

xCirusX
17
Years of Service
User Offline
Joined: 24th Jan 2007
Location: 42
Posted: 30th Apr 2007 18:01
Thanks TDK! I did search for that, but still had a few questions (at the beginning of the thread) that I wasn't to sure about...

I'm just trying to do this code a bit too different I guess... also, I realized that the function

is in the wrong structure because it really isn't doing what I designed it do here

which would be to first show the inputed letter at the first place... Which I now see would make NO sense. there fore I might revert back to something else, in turn making it a bit too long for my confort



I just need to figure out a way to call them up without lengthening the second snippet there
xCirusX
17
Years of Service
User Offline
Joined: 24th Jan 2007
Location: 42
Posted: 30th Apr 2007 19:53
Sorry... just realized I messed up on the second snippet anyways...
Should look like this:
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 1st May 2007 02:53
That really does seem a very long-winded way to do it!

As I explained in a couple of the other hangman threads:

1. Choose your word (Eg: Banana)

2. Put it into a string variable (Eg: ChosenWord$)

3. Make a copy of it (Eg; UserWord$)

4. Replace all the letters of the stored word with asterisks (becomes ******)

5. Set the font and text size then use Center Text X,Y,UserWord$ to print it on the screen.

When a user guesses a letter, modify UserWord$ by swapping out the asterisks for their corresponding letters. When you print the word again, only the letters not chosen appear as asterisks.

When UserWord$ equals ChosenWord$ then the user has guessed it and game is over.

TDK_Man

xCirusX
17
Years of Service
User Offline
Joined: 24th Jan 2007
Location: 42
Posted: 3rd May 2007 09:40
Thanks again!

I had another question as well.
Is there any reason that this doesn't work?


I thought that it should, but I must be doing something wrong...

I was just trying something for a different line spacing for words.

Thanks again
xCirusX
17
Years of Service
User Offline
Joined: 24th Jan 2007
Location: 42
Posted: 3rd May 2007 10:34
@TDK
Out of curiosity, 'ChosenWord$' would be 'word$' and 'UserWord$' would be 'oword$' in my code, right?
xCirusX
17
Years of Service
User Offline
Joined: 24th Jan 2007
Location: 42
Posted: 3rd May 2007 12:53
Awesome... here is my code so far:


Now I just need to work on a way to take out the inputed letters.



I think that should work, I just don't know the reight area to put it... I think it should be under this:


Thanks again!

Login to post a reply

Server time is: 2024-09-25 21:24:37
Your offset time is: 2024-09-25 21:24:37