My first project needs a li'l help
Posted: Sat Nov 19, 2016 11:06 am
Hi everyone, nice to meet ya! I'm fairly new to qbasic and I'm doing my first "game" to figure things out and I must say it's alot of fun, hard but fun. Anyway, I'm doing a simple virtual pet, so far the things I've got down is a small selection of randomly chosen names of the "pet", as well as a randomly selected appearance. The first thing I'd like some pointers on is how do I make this creature move about on it's own? I have a vague idea about it involving a randomized timer but I can't get the hang of it, am I right in my assumption that I need to do something like this?:
[Yes, I know it's not the correct syntax at all, I'm just asking if my general idea is right]
This is what my code is so far:
Best regards // Zambaku
Code: Select all
num3! = INT(RND * 3) + 1
IF num3! = 1 then LOCATE 18, 40
IF num3! = 2 then LOCATE 18, 40 + 1
IF num3! = 3 then LOCATE 18, 40 - 1
This is what my code is so far:
Code: Select all
CLS
num1! = INT(RND * 10) + 1
PRINT "NAME:";
IF num1! = 1 THEN PRINT "BOB"
IF num1! = 2 THEN PRINT "JOE"
IF num1! = 3 THEN PRINT "RICHARD"
IF num1! = 4 THEN PRINT "WILL"
IF num1! = 5 THEN PRINT "QBERT"
IF num1! = 6 THEN PRINT "ROGER"
IF num1! = 7 THEN PRINT "SVEN"
IF num1! = 8 THEN PRINT "GUNTHER"
IF num1! = 9 THEN PRINT "BARNEY"
IF num1 = 10 THEN PRINT "FRED"
num2! = INT(RND * 10) + 1
LOCATE 18, 40
IF num2! = 1 THEN PRINT "(`-`)"
IF num2! = 2 THEN PRINT "(^o^)"
IF num2! = 3 THEN PRINT "(-_-)"
IF num2! = 4 THEN PRINT "(>_<)"
IF num2! = 5 THEN PRINT "(T_T)"
IF num2! = 6 THEN PRINT "(X_X)"
IF num2! = 7 THEN PRINT "(x_X)"
IF num2! = 8 THEN PRINT "(~_~)"
IF num2! = 9 THEN PRINT "(`o`)"
IF num2! = 10 THEN PRINT "(p_-)"