Posted: Sat Jan 21, 2012 11:40 pm Post subject: Running something in backround?
What is it you are trying to achieve?
I want a loop to be running in backround. Example : A loop is animating a missle coming to a character, i want the user to be able to move the character, but still have that missle moving smoothly
What is the problem you are having?
Ny problem at the moment is im unsure how to do it, i was told by a friend to use procedures, but have never worked with it, and i so far have a moving character (a moving square) but still unsure how to add in the missle
Turing:
var x1 :int:=300% used for coords of character| var y1 :int:=10% | var x2 :int:=330% | var y2 :int:=40% | %_________________________________________________| var x3 :int:=700% used for coords of missle | var y3 :int:=10% | var x4 :int:=670% | var y4 :int:=40% | %________________________________________________| var col :int:=52% color of character var pressed :arraycharofboolean
Please specify what version of Turing you are using
<Answer Here>
Sponsor Sponsor
bc123
Posted: Sat Jan 21, 2012 11:45 pm Post subject: RE:Running something in backround?
also, forgot to mention i forgot how to make a limit on how far the x1 and x2 can move to :s any ideas?
Alex C.
Posted: Sat Jan 21, 2012 11:56 pm Post subject: Re: Running something in backround?
yeah, what version of turing
Alex C.
Posted: Sat Jan 21, 2012 11:57 pm Post subject: RE:Running something in backround?
oh and second, do you have any code for your missile? (stronger straight forward attack or homing missile)
bc123
Posted: Sat Jan 21, 2012 11:59 pm Post subject: RE:Running something in backround?
4.1.1
and no, i only have variables set for the missle
and another example of what i want, im working on this other game, and ill need this to have a backround constantly scrolling, then there will be a character that is running in one spot.
thnx
EDIT :
oh and i am going for a side attack, either from left or right
Alex C.
Posted: Sun Jan 22, 2012 12:04 am Post subject: RE:Running something in backround?
make your missile coordinate try to be as close to the the characters coordinates...
example
charx>missilex
missilex-5
etc
Alex C.
Posted: Sun Jan 22, 2012 12:05 am Post subject: RE:Running something in backround?
for limiting x and y...
if char x > maxboundaryx then
char x -= amount character moved right....
etc
bc123
Posted: Sun Jan 22, 2012 12:06 am Post subject: RE:Running something in backround?
im confused :s why do charx > misslex? also i made this little example, of how i would animate a missle
Turing:
var x3 :int:=700 var y3 :int:=10 var x4 :int:=670 var y4 :int:=40 loop Draw.FillBox(x3, y3, x4, y4, black)
Posted: Sun Jan 22, 2012 12:09 am Post subject: RE:Running something in backround?
the greater the x value the farther right you are...
so if you want the missile to follow you and you are farther right, you add to the missiles x value to make it go FARTHER RIGHT
simple math...
bc123
Posted: Sun Jan 22, 2012 12:10 am Post subject: RE:Running something in backround?
oh, i just figured out limits my own way :s i bassicaly did
if x1 > 11 then
x1 := x1 + 10
end if
if x2 > 31 then
x2 := x2 + 10
end if
and the box is 30x30 (i think :s) but it does work :s jus a little more pointless lines of code
Alex C.
Posted: Sun Jan 22, 2012 12:12 am Post subject: RE:Running something in backround?
by the way your jumping makes you go farther into the ground...
bc123
Posted: Sun Jan 22, 2012 12:12 am Post subject: RE:Running something in backround?
well my idea is no matter what, the missle would scroll across the screen, and your character would jump over it, and the missle would continue on, but if i had a loop with an animation of a missle scrolling with its own delays, if i press the arrow keys and delay the characters movement, then wouldnt it affect the speed of the missle??
bc123
Posted: Sun Jan 22, 2012 12:15 am Post subject: RE:Running something in backround?
yes, i realized that when i ran it, just remove one of these chunks
how many times is the character delayed in comparision to the missile?
bc123
Posted: Sun Jan 22, 2012 12:18 am Post subject: RE:Running something in backround?
well if u jump, i have like 6 delays, wont that affect the missle? like it will take longer to get through the loop to add distance to the missle and output it