Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Share Worlds (http://www.alice.org/community/forumdisplay.php?f=6)
-   -   RTS Movement (http://www.alice.org/community/showthread.php?t=11114)

RavenOfCode 04-26-2015 02:54 PM

RTS Movement
 
2 Attachment(s)
I decided to mess around with my RTS movement world again... And here is what I came up with.

It works 100% for me.

Please leave a comment on how accurate it is for you. :)

The main change is that if you preset your window size it should work
[ATTACH]7100[/ATTACH]


Thanks,

RavenOfCode

x2495iiii 04-27-2015 06:18 AM

Yeah, I remember making a similar movement style that was based on a certain window size.

I went with 800x600.

Good job!

MrMoke 04-27-2015 11:57 AM

Challenge
 
OK ROC- That's OK, but---

I challenge you to make the following changes to you logic, so that the Play window can be modified to any full-pane sizes, and still work accurately.

1) Use the Rendering preferences to modify the play width and height to a different standard size.

2) Modify the code to prompt your user to click somewhere that will allow you to compute the value of any variables that you may need. Use any fixed variables that you may need only in this portion of your code.

3) Use those newly created variables along with the distance from top/left to control the ball movement.

Only took me a few minutes after I got my head wrapped around it.

RavenOfCode 04-27-2015 06:17 PM

[QUOTE=MrMoke;56100]OK ROC- That's OK, but---

I challenge you to make the following changes to you logic, so that the Play window can be modified to any full-pane sizes, and still work accurately.

1) Use the Rendering preferences to modify the play width and height to a different standard size.

2) Modify the code to prompt your user to click somewhere that will allow you to compute the value of any variables that you may need. Use any fixed variables that you may need only in this portion of your code.

3) Use those newly created variables along with the distance from top/left to control the ball movement.

Only took me a few minutes after I got my head wrapped around it.[/QUOTE]

Im confused... Isnt this what im doing?

1. I set the render size.

2. I do this in the first part of the moveTo method.

3. I do this in the seconds part of the moveTo method...

MrMoke 04-27-2015 06:26 PM

OK- Assume that it's working properly.

Now go back into Rendering, change the size of the window, restart your program and see if it still works without coding changes.

Mine does.;)

x2495iiii 04-28-2015 05:36 AM

I remember doing this too! A bunch of us did, actually.

We called it calibration...because that's kinda what it was :P

RavenOfCode 04-28-2015 06:43 AM

[QUOTE=MrMoke;56104]OK- Assume that it's working properly.

Now go back into Rendering, change the size of the window, restart your program and see if it still works without coding changes.

Mine does.;)[/QUOTE]


hmm... ill think up something... since I have a large test coming up I most likely wont sit down and do it till Thursday...

MrMoke 04-28-2015 11:35 AM

A large test - oh boy!!!
I hope it's standardized!
I love large standardized tests.

Nothing better for teaching you to become a robot :rolleyes:

Oh Yeah- I'm up to version 2 now.

RavenOfCode 04-28-2015 04:32 PM

[QUOTE=MrMoke;56112]A large test - oh boy!!!
I hope it's standardized!
I love large standardized tests.

Nothing better for teaching you to become a robot :rolleyes:

Oh Yeah- I'm up to version 2 now.[/QUOTE]

Standardized... i wish... I guess latin isnt so bad... oh wait its horrible... :/

x2495iiii 04-29-2015 05:59 AM

Semper ubi sub ubi


All times are GMT -5. The time now is 08:10 AM.

Copyright ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.