Posted: Sun Jan 27, 2013 11:03 am Post subject: Gotta Question
hello i have aslight problem and i was wondering if you could help its a 2d rpg and wen i move a space it moves a whole tile and i was wondering if there was a way to smooth out the movement... i looked it up on google and i found a couple but i dont understand them :/
Sponsor Sponsor
Insectoid
Posted: Sun Jan 27, 2013 12:20 pm Post subject: RE:Gotta Question
Use an animation procedure. Instead of just jumping the character from tile 1 to tile 2 when a key is pressed, activate an animation to move the character across tiles pixel by pixel.
Dazzle
Posted: Sun Jan 27, 2013 2:41 pm Post subject: RE:Gotta Question
Could you possible give me an example?
Tony
Posted: Sun Jan 27, 2013 2:46 pm Post subject: RE:Gotta Question
code:
for i: 1..100 by 1
Draw.FillOval(i,100,10,10,red)
delay(100)
cls
end for
vs.
code:
for i: 1..100 by 10
Draw.FillOval(i,100,10,10,red)
delay(100)
cls
end for
Posted: Sun Jan 27, 2013 6:29 pm Post subject: RE:Gotta Question
no, i am just wondering how i could move at that speed wen i try to change the speed to under 1 is just gives me and errror..?? but how do i move at pixels
Tony
Posted: Sun Jan 27, 2013 6:57 pm Post subject: RE:Gotta Question
Posted: Sun Jan 27, 2013 10:06 pm Post subject: RE:Gotta Question
Assigned Value Is the Wrong Type.
Tony
Posted: Mon Jan 28, 2013 2:41 am Post subject: RE:Gotta Question
Turing is strongly typed, so the type of variable and the values assigned to it must match up.
code:
var count : int := "some text"
put count
Here it's not at all clear what integer value a text is suppost to represent, so an error is thrown. It works the same way for real values and integers. To make it clear to the compiler that you know what you are doing, you'd have to build in your conversions yourself, such as rounding the numbers the way that you want.
Posted: Mon Jan 28, 2013 9:57 am Post subject: RE:Gotta Question
i am a beginner .. and i dont understand everything that poeple are say would you like me to put the code that im using in here?
DemonWasp
Posted: Mon Jan 28, 2013 10:09 am Post subject: RE:Gotta Question
You should generally paste the relevant code whenever it changes. I'll explain what Tony is saying though:
In short, you're trying to put a square peg into a round hole. When you make a variable have type "int", it can only hold "integer" values, such as 1, 2, 3, -17, etc. It can't hold values like 0.5 or 3/4 (which are called "real" numbers, or "floating point" in computers).
Turing is trying to tell you this. The assigned value of 0.5 or whatever is the wrong type for the variable's type, which is integer. If you need to represent fractional numbers, then you should use the type real (commonly called "float" or "double" in other languages.
Dazzle
Posted: Mon Jan 28, 2013 10:50 am Post subject: RE:Gotta Question