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.

DarkBASIC Professional Discussion / Fighting using math

Author
Message
Mikeygd3
12
Years of Service
User Offline
Joined: 18th Dec 2013
Location:
Posted: 14th Mar 2014 16:07
im working on an educational game and i wanna know how to display a math problem over an enemy (and each enemy to have a diff problem) and once it approaches me, i cant move until i attempt the problem. if i get it wrong, i get hurt and it switches from 3 problems it has. if i get it right, it attacks

i know its alot sorry but i need professional help :/
ShellfishGames
13
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 14th Mar 2014 17:49
Quote: "(each enemy to have a diff problem)"




Quote: "display a math problem over an enemy"




Quote: "once it approaches me, i cant move"




Quote: "attempt the problem"


There are many ways to do it, from multiple choice (simply pressing a key to select an answer) to typing in the complete answer. Anyway, you'll probably need inkey$() or keystate(keyCode) or entry$() + clear entry buffer or the mousex()/mousey()/mouseclick() depending on your approach.

Quote: " if i get it wrong, i get hurt and it switches from 3 problems it has."




Quote: "if i get it right, it attacks"


Does that make sense? If you get it wrong, you get hurt, and if you get it right, it attacks you nonetheless?

Quote: "i know its alot"


Most certainly too much. If you really want to stick to this plan, start of by working on the theoretical concept behind it on paper. It's best to have all questions answered about how the game will behave exactly before you start the actual implementation. For instance:
-will the math problems be randomly generated or will there be a predefined database?
-when does an enemy "approach you"? What's the distance defining this? How to enemies move in the first place? Do they have an AI? Will all the enemies keep moving if one has just approached the player, which might result in more than one enemy approaching him at the same time?
-how exactly will the player "attempt the problem"?

(You're not supposed to answer these questions in this thread, but rather for you personally to make sure you know how you'll approach the implementation)

Once you've figured all this out, you'll either be able to continue yourself, or you ask us here - but ideally more specific questions than the one at hand.

Mikeygd3
12
Years of Service
User Offline
Joined: 18th Dec 2013
Location:
Posted: 21st Mar 2014 16:46
@ShellfishGames
how do i make it so the player has to type the answer?
and thank you alot for the help
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 21st Mar 2014 17:04
I had a similar problem with a typing tutorial game a while ago. I had these 9 typists, and they'd hold up words for the player to type, and if the player miss-types then the word is lost and the little typist gets onto making a new word. The tricky / similar part is that I had to track 9 possible targets for the text entry.

In the end, I just checked the entry sequence against each word, and any words that didn't match are ignored.

So, if you have 2 enemies, and the answer to 1 is 10 and the answer to the other is 15, then maybe you just have to check the input for the correct answer each time, even though the first digit would be right in both cases, the 15 enemy should be killed when entering 15, and the 10 enemy should be left alone. Maybe it would be easier to avoid having any wrong answers, like instead of wrong answers, maybe a time limit, or enemy limit would work better - because you might have 5 different enemies looking for 5 different answers - the best way I've found around that is to simply have 5 different enemies looking to die as soon as the player enters their answer... concentrate on the question the player answered correctly, not the 4 questions that haven't been answered yet.

I am the one who knocks...
Mikeygd3
12
Years of Service
User Offline
Joined: 18th Dec 2013
Location:
Posted: 1st Apr 2014 18:22
i havent thought of fighting 2 at a time but thats cool. do you have any code on what you were saying?
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 3rd Apr 2014 01:00
Quote: "how do i make it so the player has to type the answer?"

Does this help?
Mikeygd3
12
Years of Service
User Offline
Joined: 18th Dec 2013
Location:
Posted: 7th Apr 2014 18:36
how do i get them to show what they are typing?

Login to post a reply

Server time is: 2026-07-07 00:08:22
Your offset time is: 2026-07-07 00:08:22