Problem with turing
Author |
Message |
krishon
|
Posted: Tue Nov 26, 2002 11:47 pm Post subject: (No subject) |
|
|
could u sorta write a small code as example for the first one, cuz i'm a bit confused. The other two won't work cuz the one u put the code for rounds the number up, which i dun't want it to do. I'll only add a level once it reaches an int. No .1 higher or lower. Just at the interger. The second one i'm probably not gonna try since u said it might screw me up. I'll take ur word for it since ur more experienced than i am. But thx for the help. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Wed Nov 27, 2002 12:24 am Post subject: (No subject) |
|
|
well here's how I would have done it:
code: | var currentExp: int :=0 %experience of char
var lvlExp: int :=100 %experience needed to lvl
if currentExp >= lvlExp then
charLVL = charLVL + 1 %grow 1 level
currentExp:= currentExp - lvlExp %set experience to 0 + remainder
lvlExp := lvlExp * 2 %increase experience amount needed to level again
end if |
so based on this code, your character will level at experience:
100
200
400
800
1600
...
as they do in most of the games. You can change that to w/e other number you want... If you wanna multiply by a decimal, you got to convert real to int. (Round/Ceil/Floor) |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
krishon
|
Posted: Wed Nov 27, 2002 12:27 am Post subject: (No subject) |
|
|
k, that makes much more sense. Thx |
|
|
|
|
|
Tony
|
|
|
|
|
krishon
|
Posted: Wed Nov 27, 2002 1:08 am Post subject: (No subject) |
|
|
another problem. i have two different characters that the user can choose from. If i type in the other character, it exits all the loops of the character which i did not type, but it did not proceed to the code following the character which i chose. y is this happenin?? |
|
|
|
|
|
Tony
|
Posted: Wed Nov 27, 2002 1:16 am Post subject: (No subject) |
|
|
i donno? flags? bad character set up?
here's how it should be:
code: |
if character = "tony" then
name:= "tony"
strength:=100
intelegence:=1000
picture:="tony.jpg"
%other character starts
else
name:="dan"
strength:=99
intelegence:=999
picture:="dan.gif"
%other stats
end if |
This way you have same loops for the characters, the only differences are starts, apperance, etc. If you have a poorly organized huge program with many loops, you will always experience problems when additing additional conditions for loop execution. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Dan
|
Posted: Wed Nov 27, 2002 8:43 pm Post subject: (No subject) |
|
|
tony wrote:
code: |
if character = "tony" then
name:= "tony"
strength:=100
intelegence:=1000
picture:="tony.jpg"
%other character starts
else
name:="dan"
strength:=99
intelegence:=999
picture:="dan.gif"
%other stats
end if |
Oh i only get 999 intelegenc , i see so thats how it is. JK
any way it whode help if you post your code becuse there coude be thorsends of difrent things wrong |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
Tony
|
|
|
|
|
Sponsor Sponsor
|
|
|
krishon
|
Posted: Wed Nov 27, 2002 8:50 pm Post subject: (No subject) |
|
|
i could post my code, but its 1000 lines long. i dunno if it'll have enough space for it |
|
|
|
|
|
Tony
|
Posted: Wed Nov 27, 2002 11:56 pm Post subject: (No subject) |
|
|
ya, I don't think you should post... cuz someone else might take it... I know that there're some very bad people out there...
besides, I'm not going to look through 1000 lines for someone's typo.
a little sujestion: Printing out your code and properly indenting it... linking all the loops, ifs, etc to see better. Then just go through it. Looking at a printed version often makes a difference and mistakes are found easier.
|-For i:1..10
|~~~|-If i=1 then
|~~~| put "moo"
|~~~|-End if
|-End For
Do something like that... well No "~"s, its just that this forum removes all the extra spaces |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
krishon
|
Posted: Thu Nov 28, 2002 12:11 am Post subject: (No subject) |
|
|
k, i'll give it a try. But this question is for dan since he told ted livingston how to save variables and load them. How can make the game continue after i load the variables. For example, i save a game. When i come back to load the game, i need it to go directly where it left off. How can i do that??? |
|
|
|
|
|
Dan
|
Posted: Thu Nov 28, 2002 1:39 am Post subject: la la la |
|
|
well i am not shure what your game looks like but here are some qiuck tips. your game shode have a var for the x and y qorantes of the guy and if you have more then one map/screen you shode have a var that stores this data too. what you do is incopreat this data in to the save and load parts of your code. then when you load the saved that set those vars to the saves and refyrsh the screen if you got maps and stuff.
i am not shure but from the sownds of your other posted it sownds like you progame is all in loops i whode sugested making fuctions and or porgecers to keep your progame oragiesed.
my msn is dan@danpages.com if you take to me there i can send you the code for my rpg that delas witha lot of this. you may also whont to coseder haveing save points in the gam to cut down of the difrent amout of sopts where they can start. this will help stop some odd bugs you can get. |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
Dan
|
Posted: Thu Nov 28, 2002 1:49 am Post subject: QFTB |
|
|
i upload the code for my rpg and the map maker for my rpg to the server so you can now download them at:
QFTB code/pics/musik/vidoe - instaler
QFTB mapmaker with demo maps - code and pics
P.S. i turst that you will not steal the code but this is for other poleop, plz do not stael the code, i wroked very hread on this you can use pices and some of the fuctions and proges from it but plz give me credit in your code. thx. also if you got any code that uses parts of this game i whode like to see how you used them and i might upload them to this site if you whont. |
|
|
|
|
|
krishon
|
Posted: Thu Nov 28, 2002 11:35 am Post subject: (No subject) |
|
|
no. I won't steal it. I worked for like 10 hours on my thing. I'm not gonna waste 10 hours just to copy ur program. |
|
|
|
|
|
krishon
|
Posted: Thu Nov 28, 2002 11:54 am Post subject: (No subject) |
|
|
i have an idea, you can make it a read-only file so that no one can change it. |
|
|
|
|
|
|
|