I've clearly been watching too much Star Trek lately. I sat down and wrote a very, very simple app that would render something similar to the warp effect (the stars flying by the window).
Controls:
Up: increase speed.
Down: decrease speed.
Left: rotate counterclockwise.
Right: rotate clockwise.
+ / = / kp+: add a star.
- / _ / kp-: delete a star.
Space: toggle pause.
Tab: toggle smoothing.
Escape: exit app.
Thoughts, comments, improvements?
Warp
- tentus
- Inner party member
- Posts: 1060
- Joined: Sun Oct 31, 2010 7:56 pm
- Location: Appalachia
- Contact:
Re: Warp
Their distance from the "camera" determines their speed, length, and scale. More distant stars travel more slowly, closer stars travel more quickly, and appear larger with longer tails.slime wrote:Cool! You should make the length of the stars based on their speed relative to you rather than just their 'distance'.
Version 2 includes the ability to add and delete stars (the default is 32 stars onscreen at once).
Kurosuke needs beta testers
- SoggyWaffles
- Citizen
- Posts: 72
- Joined: Sun Jan 02, 2011 3:27 am
- Location: Wyoming, USA
Re: Warp
Brings back memories of Flying Toasters.....
"Beneath the clouds lives the Earth-Mother from whom is derived the Water of Life, who at her bosom feeds plants, animals and men." ~Larousse
- slime
- Solid Snayke
- Posts: 3162
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Warp
The tail lengths need to increase/decrease as your speed increases/decreases though.tentus wrote:Their distance from the "camera" determines their speed, length, and scale. More distant stars travel more slowly, closer stars travel more quickly, and appear larger with longer tails.slime wrote:Cool! You should make the length of the stars based on their speed relative to you rather than just their 'distance'.
Version 2 includes the ability to add and delete stars (the default is 32 stars onscreen at once).
- tentus
- Inner party member
- Posts: 1060
- Joined: Sun Oct 31, 2010 7:56 pm
- Location: Appalachia
- Contact:
Re: Warp
Oh I gotcha I thought you were referring to the star speed, not the camera speed. Hmm. I'll think on it.slime wrote:The tail lengths need to increase/decrease as your speed increases/decreases though.tentus wrote:Their distance from the "camera" determines their speed, length, and scale. More distant stars travel more slowly, closer stars travel more quickly, and appear larger with longer tails.slime wrote:Cool! You should make the length of the stars based on their speed relative to you rather than just their 'distance'.
Version 2 includes the ability to add and delete stars (the default is 32 stars onscreen at once).
In the meantime, I introduced a smoothing option. The old code is still there, you can see it in action by hitting space to toggle smoothing.
Does anyone else find it a little weird that the ImageData stuff is all indexed at 0, rather than 1 like most of the rest of Love? I mean, it's not a big deal, it's just a little jolting the first time you mess it up and Love crashes without an error.
Kurosuke needs beta testers
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Warp
The increase/decrease speed looks "bumpy" - at least on my computer, stars' positions change (or are reset, not sure) a lot with each velocity increase.
I have not seen the code. Would it be very difficult to make it multi-directional (move up/down/left/right or anything in between, instead of just "left")?
I have not seen the code. Would it be very difficult to make it multi-directional (move up/down/left/right or anything in between, instead of just "left")?
When I write def I mean function.
- tentus
- Inner party member
- Posts: 1060
- Joined: Sun Oct 31, 2010 7:56 pm
- Location: Appalachia
- Contact:
Re: Warp
Yeah, I need to figure out the discrepancy (offset x somehow)?kikito wrote:The increase/decrease speed looks "bumpy" - at least on my computer, stars' positions change (or are reset, not sure) a lot with each velocity increase.
I have not seen the code. Would it be very difficult to make it multi-directional (move up/down/left/right or anything in between, instead of just "left")?
Considering how short the app is, I don't think adding multiple directions would be too hard. The easiest thing to do would be adjust the size of it and use love.graphics.rotate.
Kurosuke needs beta testers
- tentus
- Inner party member
- Posts: 1060
- Joined: Sun Oct 31, 2010 7:56 pm
- Location: Appalachia
- Contact:
Re: Warp
Alright, rotating is now in effect, use the arrow keys, and you can pause using space. Adding and deleting stars is now done with plus and minus, and toggling smoothing is now done with tab. The position bug should be fixed now, after a ton of fiddling around (end solution: flip the image backwards, the math for displacing it to the left was just too easy to break).kikito wrote:The increase/decrease speed looks "bumpy" - at least on my computer, stars' positions change (or are reset, not sure) a lot with each velocity increase.
I have not seen the code. Would it be very difficult to make it multi-directional (move up/down/left/right or anything in between, instead of just "left")?
Kurosuke needs beta testers
Who is online
Users browsing this forum: No registered users and 0 guests