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 / Old Frog says

Author
Message
JaNiM
18
Years of Service
User Offline
Joined: 1st Apr 2006
Location: Montreal
Posted: 30th May 2006 04:08
Is this good

Simple math game.

for now runs ok but?



I put everything in functions but my input routine does not seem

to rely on the main loop
inkey$() is made with a repeat until statement if taken off
the program kills all my player allowed life one by one


if you need more info please do i'm no pro like you guys
but would like to go further.



Thank you i need to put a timer in there.
Hope you can help me out

this is kind of a test

JaNiM
Zeddex
18
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 31st May 2006 18:10
maybe if you use a simple sub for the function becose you don t send back any var at the end of your function,

use

Inpu:
code jere
return

and to call it, use gosub Inpu

but i don t anderstand the question

If Zeddex can, you can. If you have an idea, make it.
Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 31st May 2006 18:54
Any variable assigment inside a function will only be valid inside that function. As soon as your function ends, the variable will be deleted. Is that what's wrong?

JaNiM
18
Years of Service
User Offline
Joined: 1st Apr 2006
Location: Montreal
Posted: 1st Jun 2006 03:41
Well the prog goes like this

setup
declare variables
load media, sprites, background "that i did"
like some body said in one post newgame() "function
display personal logo, game tittle

do loop start
check for exit game
if menu =0 menu()

prob() "display problem"
sprit() "display sprites"

inpu() "check for input", "i had to put check for quit here becose of
repeat until statement", i also put the back to menu option here for the same reason"

repo() "check answer", "here check for bonus"

if lives =0 end()

loop "close loop"
end

now this is the structure i chose "WICH WORKS FINE" for now

function with branching to another function prob
had to repeat a few logics inside each function
not sure if it ok
well i dont know about structure and prog logic.
maybe i should post the whole prog for you to comment
and bring it to higher levels.

i'm sure i should put every check inside the main loop but?

JaNiM

Login to post a reply

Server time is: 2024-11-27 18:29:27
Your offset time is: 2024-11-27 18:29:27