Author Topic: Asteroid Designer  (Read 108313 times)

0 Members and 1 Guest are viewing this topic.

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Asteroid Designer
« on: May 27, 2011, 10:36:54 PM »
EDIT:  This was an early version!

Click here for the latest version.





This level file is designed to help you visually design asteroid fields.

Download the level file and place in the appropriate folder.
Load the level in Eufloria.

Left-click and drag to move asteroids around.
Right-click an asteroid to select it without moving it.
Use the two small buttons in the top left to increase and decrease the size of the selected asteroid.
Use the larger button in the top left to output the code that would create this asteroid field to a folder on your C drive.

By default there are 20 asteroids.  To change this, open Asteroid Designer.lua and change the "roidnumber" variable at the top.


With huge thanks to Aino for showing us all the way with regard to IO, and for use of his GetMouseX() and GetMouseY() functions.
Enjoy :>
« Last Edit: July 06, 2011, 05:13:52 PM by annikk.exe »

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 27
  • Posts: 1,523
  • They'll eat you next!
  • Eufloria: Yes
Re: Asteroid Designer
« Reply #1 on: May 27, 2011, 10:38:18 PM »
Yay, testing it out now :)

Edit - Looked at the code, may add some kinda possibility to add asteroid in-game... It's not gonna crash ro anything aslong as you use it in OnMouseLeftDown or something :)
« Last Edit: May 27, 2011, 10:41:22 PM by Aino »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Asteroid Designer
« Reply #2 on: May 27, 2011, 10:43:47 PM »
Feel free :>  I just wanted to make a basic one as this is a means to an end for me.  I couldn't be bothered manually figuring out what values looked best and typing them in by hand, so I made this..

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 27
  • Posts: 1,523
  • They'll eat you next!
  • Eufloria: Yes
Re: Asteroid Designer
« Reply #3 on: May 27, 2011, 10:45:31 PM »
Yeah, but it would be very sad to jsut end up with no more avail. roids :)

I'll add it soon, I might also add a hold for the size configuration :)

Thanks for making it though, helps alot :)

Edit: now I got very inventful, I suddenly wanna make it a possibility to change the senddistance, it would be neat to jsut click on the senddistance ring and just drag it out? :D

Edit 2: And I changed it to directly save it to lua and make it a directly playable map :)

Hope all this is ok for you :)
« Last Edit: May 27, 2011, 10:51:47 PM by Aino »

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Asteroid Designer
« Reply #4 on: May 27, 2011, 10:50:14 PM »
Left-clicking on the send-distance ring causes you to deselect the asteroid, which makes the ring disappear!
I suspect you'd have to do it with more buttons.  :>
Ultimately you'd probably want to have text labels on buttons as well.


A really really nice addition would be that if you click and hold one of the size increase or decrease buttons, after a moment the size goes up or down fast.  :>  Just like if you hold down the space bar on your keyboard, after a moment it starts adding lots of spaces.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 27
  • Posts: 1,523
  • They'll eat you next!
  • Eufloria: Yes
Re: Asteroid Designer
« Reply #5 on: May 27, 2011, 10:53:16 PM »
That seems simple done :)

I've been coding too much lately: I can see the codes before I write them(which also makes stuff alot easier though :))...

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Asteroid Designer
« Reply #6 on: May 27, 2011, 11:05:48 PM »
I know the feeling!

It's when you start to think of lua as a language like English...  you can express certain thoughts and ideas in Lua that are actually harder to say in English.  Bizarre.  :>


Anyway... I was thinking about the send distance problem.  Maybe the best way to build the UI would be to have several different "toggle" buttons, so when you click a button, it deselects the other buttons automatically.
The buttons would each correspond to a different stat; Position, Size, Send Distance, etc.  Then you could use left-click-and-drag actions to change each of these attributes.

Suppose you have Position selected.  Dragging an asteroid would move the asteroid around.
Suppose you then click on "Size", this would deselect "Position" and now dragging an asteroid would cause it to change size.
Finally, you click the "Send Distance" button, this would deselect the "Size" button.  Now dragging the asteroid around causes the Send Distance to change.


I think that UI scheme would be the easiest to use personally.  Much more elegant than having + and - buttons for everything.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 27
  • Posts: 1,523
  • They'll eat you next!
  • Eufloria: Yes
Re: Asteroid Designer
« Reply #7 on: May 27, 2011, 11:11:27 PM »
I was just think of making it so when you select: it uses Pythagoras' to find out if the distance between the asteroid and the mouse is equakl to something around the senddistance, then it will ignore everything else :)

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Asteroid Designer
« Reply #8 on: May 27, 2011, 11:15:24 PM »
Try clicking on a send distance ring in-game, you'll hopefully see what I mean...

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 27
  • Posts: 1,523
  • They'll eat you next!
  • Eufloria: Yes
Re: Asteroid Designer
« Reply #9 on: May 27, 2011, 11:18:56 PM »
I know what you mean, but when you click on the boxes to increase radius, what happens then?

By the way, I think it would be awesome to change senddistance and radius that way :D

But first I'll atleast make that this we talked about first :P

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 27
  • Posts: 1,523
  • They'll eat you next!
  • Eufloria: Yes
Re: Asteroid Designer
« Reply #10 on: May 27, 2011, 11:21:59 PM »
Hmmm, you're right: It disappears, didn't think of that. Derp

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Asteroid Designer
« Reply #11 on: May 27, 2011, 11:30:11 PM »
Dragging the asteroid doesn't create that problem though, hence the toggle button approach.  :>

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 27
  • Posts: 1,523
  • They'll eat you next!
  • Eufloria: Yes
Re: Asteroid Designer
« Reply #12 on: May 27, 2011, 11:46:01 PM »
Kay, came into some problems, so I was slightly delayed :P

(vector3f problems, hate those x.x!)

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Asteroid Designer
« Reply #13 on: May 27, 2011, 11:59:25 PM »
In the mean time, I just designed an asteroid field and inserted it into the new level that I'm working on.  :D


This tool should make it relatively simple to create huge, organic-looking asteroid fields, EG like Montezuma's Revenge.  Hopefully some sweet levels will be designed with it!

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 4
  • -Receive: 27
  • Posts: 1,523
  • They'll eat you next!
  • Eufloria: Yes
Re: Asteroid Designer
« Reply #14 on: May 28, 2011, 12:12:25 AM »
Ok, added alot of stuff xD

- Adding asteroids
- Hold to increase radius
- Infinite "grid"
- HUGE MAP(though this won't be when you play the map you've made :))
- Creates a fully playable map right after saving it :)