Posted: Mon Jan 28, 2013 12:49 pm Post subject: RE:Gotta Question
Nope, because the number you set is already an integer type, not a real type.
Instead of var integerNumber : int, you want var realNumber : real. Classify it as a real, not an int.
Sponsor Sponsor
Dazzle
Posted: Mon Jan 28, 2013 9:10 pm Post subject: RE:Gotta Question
ohhhhhh.... OMG thank you soo much.. im gunna try it now i hope it works
Dazzle
Posted: Mon Jan 28, 2013 9:37 pm Post subject: Re: Gotta Question
ok so.. i get it but its not working :/ heres the code im working with
code:
loop
reDraw
Input.KeyDown (key)
if key ('a') and tiles (px - 1, py) = 0 then
var player_movement : real :=0.25
px -=player_movement Pic.Draw (wizard3 ,px * 32, py * 32,0)
View.Update
end if
if key ('d') and tiles (px + 1, py) = 0 then
movement Pic.Draw (wizard1 ,px * 32, py * 32,0)
View.Update
end if
if key('s') and tiles (px , py - 1) = 0 then
movement Pic.Draw (wizard2 ,px * 32, py * 32,0)
View.Update
end if
if key ('w') and tiles (px , py + 1) = 0 then
movement Pic.Draw (wizard0 ,px * 32, py * 32,0)
View.Update
end if
delay (50)
end loop
Got any ideas??
Tony
Posted: Tue Jan 29, 2013 12:12 am Post subject: RE:Gotta Question
code:
var player_movement : real :=0.25
px -=player_movement
That takes care of the first of four steps, but currently you have no way of remembering that those steps began to happen. When should you do the second 0.25?
Posted: Tue Jan 29, 2013 7:46 am Post subject: RE:Gotta Question
yea.. lol i did try. ;p .. but here ill ask agan how can i move by pixels not tiles?
Insectoid
Posted: Tue Jan 29, 2013 2:00 pm Post subject: RE:Gotta Question
code:
Pic.Draw (wizard1 ,px * 32, py * 32,0)
As long as you're drawing to px*32, py*32, you will not be able to move by pixels.
Sponsor Sponsor
Tony
Posted: Tue Jan 29, 2013 3:25 pm Post subject: RE:Gotta Question
quarter-tile steps are fine -- e.g. round(0.25 * 32). But there needs to be a mechanism to remember to take the other 3 steps during the following game frames.