Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LocH & LocV usage without if statements

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I need to create a program without if statments, repeat, update stage. In single frame, which: has 5 buttons: up down left right stop. when up is pressed an object starts moving up, etc. Help Please.
 
so many ways to do it I don't know where to start.
I am assuming your a student so I'm not going to spoon feed you the solution.

Basically you will need an exitframe script on the object that needs to move something like

on exitframe me
global gXmove, gYmove
sprite(me.sprite).locX = gXmove
sprite(me.sprite).locY = gYmove
end

on the 5 buttons you will need 5 different scripts kinda like

on mouseup
global gXmove
gXmove = how far it should move, either -1, 0 or 1 (bigger numbers for faster)
end

and a frame script
on exitframe
go to the frame
end

ok, thats all im going to give you, should be enough to work out the rest (hmm, I think I ended up spoon feeding you the solution anyway...apart from the errors in that first exitframe script)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top