As the name of this post suggests, I haven't been able to get all that much coding done today. I only just managed to get onto the PC, as others have been using it.
I seriously need to get some funds together for my own PC. I'll probably get a laptop, as there is nowhere to set up another PC in my house ATM.
I have written out bits of pseudo code though, so I haven't completely wasted the day.
Mostly been thinking about the "combat" system, if you can call it that.
When the player fights a monster, by default they have a 1 in 10 chance of beating them.
The way I plan on accomplishing this is using to Random function to create a random number between 0-100 (Which, if I'm not mistaken, cant actually be 100. I'm not sure if it can be 0, if anyone could give me a heads up on this it would be appreciated) and then using an if statement to see if the number is less than 10.
This way, if I replace the 100 argument when creating my random with an int, which in turn gets it value from a method, which is something like:
This way, if a player finds an item, say a sword I can do something like this:
so the next time I run the code above chance should equal 95.
I cant test this code atm, and I cant remember all the syntax, but this is the approach I'm using for now at least.
I should be able to code tomorrow, it just depends how long it takes me to repair my friends PC.
I seriously need to get some funds together for my own PC. I'll probably get a laptop, as there is nowhere to set up another PC in my house ATM.
I have written out bits of pseudo code though, so I haven't completely wasted the day.
Mostly been thinking about the "combat" system, if you can call it that.
When the player fights a monster, by default they have a 1 in 10 chance of beating them.
The way I plan on accomplishing this is using to Random function to create a random number between 0-100 (Which, if I'm not mistaken, cant actually be 100. I'm not sure if it can be 0, if anyone could give me a heads up on this it would be appreciated) and then using an if statement to see if the number is less than 10.
This way, if I replace the 100 argument when creating my random with an int, which in turn gets it value from a method, which is something like:
Code:
Random.rand = new Random();
int chance = myFunction(0);
int thing = rand.Random(0,chance);
if (thing < 10)
codehereplox
static int myFunction(int)
{
int returnedVal = 100;
returnedVal -= int;
return returnedVal
}
Code:
myFunction(5);
so the next time I run the code above chance should equal 95.
I cant test this code atm, and I cant remember all the syntax, but this is the approach I'm using for now at least.
I should be able to code tomorrow, it just depends how long it takes me to repair my friends PC.