Quote: "(each enemy to have a diff problem)"
type enemyType
objectID as integer
problem as string
solution as string
endtype
dim enemy(howManyEnemiesYouHave) as enemyType
for e = 1 to howManyEnemiesYouHave
enemy(e).objectID = whateverTheObjectIDforThisEnemyIs
enemy(e).problem = "some problem"
enemy(e).answer = "according answer"
next
Quote: "display a math problem over an enemy"
for e = 1 to howManyEnemiesYouHave
if object in screen(enemy(e).objectID)
center text object screen x(enemy(e).objectID), object screen y(enemy(e).objectID), enemy(e).problem
endif
next
Quote: "once it approaches me, i cant move"
allowMovement = 1
for e = 1 to howManyEnemiesThereAre
dx = object position x(enemy(e).objectID) - playerX
dy = ...
dz = ...
dis = sqrt(dx*dx + dy*dy + dz*dz)
if dis < minimumDistance then allowMovement = 0 : exit
next
if allowMovement
playerMovement()
endif
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."
...your code handling player input...
if playerAttempt$ <> enemy(whateverEnemyIsCurrentlyNearToThePlayer).solution
dec playerLife, someValue
enemy(whateverEnemyIsCurrentlyNearToThePlayer).problem = "some new problem"
enemy(whateverEnemyIsCurrentlyNearToThePlayer).solution = "the according solution"
endif
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.