Pages: 1
Topic closed
I have a question, I'm making a "hit'em up", it pops out from a "hole" and then you have to hit it, so my problem is making the object pop out in certain coordinates or in the center of the "holes" in a random way. thanks in advance!
Offline
Create a list with the hole coordinates, then do somthing like this:
You need to create two lists: One holding the "y" pos. of the hole, and one holding the ""x" pos.whenclicked
foreverwait(pick random 1-4) secondsset x toset y to
Last edited by mythbusteranimator (2012-05-11 10:37:35)
Offline
mythbusteranimator wrote:
Create a list with the hole coordinates, then do somthing like this:
You need to create two lists: One holding the "y" pos. of the hole, and one holding the ""x" pos.whenclicked
foreverwaitpick randomsecs1to4set x toitempick randomof1to7holecoordinatesXpos ▼set y toitempick randomof1to7holecoordinatesYpos ▼
Fixed.
Offline
trinary wrote:
mythbusteranimator wrote:
Create a list with the hole coordinates, then do somthing like this:
You need to create two lists: One holding the "y" pos. of the hole, and one holding the ""x" pos.whenclicked
foreverwaitpick randomsecs1to4set x toitempick randomof1to7holecoordinatesXpos ▼set y toitempick randomof1to7holecoordinatesYpos ▼Fixed.
You can actually just use the
block.set x toitemany ▼ofholecoordinatesXpos ▼
Offline
amcerbu wrote:
trinary wrote:
mythbusteranimator wrote:
Create a list with the hole coordinates, then do somthing like this:
You need to create two lists: One holding the "y" pos. of the hole, and one holding the ""x" pos.whenclicked
foreverwaitpick randomsecs1to4set x toitemany ▼ofholecoordinatesXpos ▼set y toitemany ▼ofholecoordinatesYpos ▼Fixed.
You can actually just use the
block.set x toitemany ▼ofholecoordinatesXpos ▼
Great point amcerbu, I changed the script. It's more efficient now.
Last edited by jontmy00 (2012-05-11 23:49:46)
Offline
d
jontmy00 wrote:
amcerbu wrote:
You can actually just use the
block.set x toitemany ▼ofholecoordinatesXpos ▼Great point amcerbu, I changed the script. It's more efficient now.
![]()
Only if the holes are on a grid-like system. Otherwise, the x and y coordinates won't match up (e.g. go to x: (item 1 of list x) y:(item 4 of list y) )
Offline
MoreGamesNow wrote:
d
jontmy00 wrote:
amcerbu wrote:
You can actually just use the
block.set x toitemany ▼ofholecoordinatesXpos ▼Great point amcerbu, I changed the script. It's more efficient now.
![]()
Only if the holes are on a grid-like system. Otherwise, the x and y coordinates won't match up (e.g. go to x: (item 1 of list x) y:(item 4 of list y) )
Hmm...I just realized that.
Maybe create avariable called "List item1" and set "list item 1" to the item number of the 'holecoordinatesxpos', and then choose item "listitem1" of 'holecoordinatesxpos'?
Offline
As in,
Hm... that might not work.set x to(item [any v] of [holex v])setlist item ▼to item(x position)ofholex ▼set y to
Offline
Also, you might want to number the holes, and use the following script, so that 2 don't appear in 1 spot.
setxnum ▼topick random1to7setynum ▼topick random1to4ifnotused ▼contains+*ynum-17xnumgo to x:itemy:xnumofx's ▼itemynumofy's ▼add*ynum-17>+xnum> toused ▼
Last edited by parcheesidude (2012-05-12 12:28:57)
Offline
This should do it:
setlistIndex ▼topick random1to7setdesiredXPosition ▼toitemlistIndexofXPositions ▼setdesiredYPosition ▼toitemlistIndexofYPositions ▼
Last edited by amcerbu (2012-05-12 11:25:29)
Offline
amcerbu wrote:
This should do it:
setlistIndex ▼topick random1to7setdesiredXPosition ▼toitemlistIndexofXPositions ▼setdesiredYPosition ▼toitemlistIndexofYPositions ▼
Even better. Everyone seems to be trying to be coming up with a better script.
Offline
jontmy00 wrote:
amcerbu wrote:
This should do it:
setlistIndex ▼topick random1to7setdesiredXPosition ▼toitemlistIndexofXPositions ▼setdesiredYPosition ▼toitemlistIndexofYPositions ▼Even better. Everyone seems to be trying to be coming up with a better script.
![]()
That works (it was right in front of me the whole time, :p)
Offline
mythbusteranimator wrote:
Create a list with the hole's coordinates, then do somthing like this:
You need to create two lists: One holding the "y" pos. of the hole, and one holding the ""x" pos.whenclicked
foreverwaitpick randomsecs1to4set x toset y to
Fixed.
Last edited by laser314 (2012-05-14 14:18:22)
Offline
Topic closed
Pages: 1