Alice Community  

Go Back   Alice Community > Alice 2 > Share Worlds

Reply
 
Thread Tools Display Modes
RTS Movement
Old
RavenOfCode
Senior Member
 
RavenOfCode's Avatar
 
Status: Offline
Posts: 408
Join Date: Oct 2013
Location: Northern Virginia
Default RTS Movement - 04-26-2015, 02:54 PM

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
RTS Help.png


Thanks,

RavenOfCode
Attached Files
File Type: a2w RTS Movement v1.2.a2w (198.2 KB, 10 views)


Stuff + Other Stuff + Different Other Stuff = Things :)

My best Alice game:

Clash of the Cubes (an arena fighting game):
http://www.alice.org/community/showthread.php?t=10738&highlight=game

Last edited by RavenOfCode; 04-26-2015 at 02:57 PM.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 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!


(')>
   
Reply With Quote
Challenge
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 500
Join Date: Sep 2007
Location: Austin, Texas
Wink Challenge - 04-27-2015, 11:57 AM

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.

Last edited by MrMoke; 04-27-2015 at 12:13 PM.
   
Reply With Quote
Old
RavenOfCode
Senior Member
 
RavenOfCode's Avatar
 
Status: Offline
Posts: 408
Join Date: Oct 2013
Location: Northern Virginia
Default 04-27-2015, 06:17 PM

Quote:
Originally Posted by MrMoke View Post
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.
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...


Stuff + Other Stuff + Different Other Stuff = Things :)

My best Alice game:

Clash of the Cubes (an arena fighting game):
http://www.alice.org/community/showthread.php?t=10738&highlight=game
   
Reply With Quote
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 500
Join Date: Sep 2007
Location: Austin, Texas
Default 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.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 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


(')>
   
Reply With Quote
Old
RavenOfCode
Senior Member
 
RavenOfCode's Avatar
 
Status: Offline
Posts: 408
Join Date: Oct 2013
Location: Northern Virginia
Default 04-28-2015, 06:43 AM

Quote:
Originally Posted by MrMoke View Post
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.

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


Stuff + Other Stuff + Different Other Stuff = Things :)

My best Alice game:

Clash of the Cubes (an arena fighting game):
http://www.alice.org/community/showthread.php?t=10738&highlight=game
   
Reply With Quote
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 500
Join Date: Sep 2007
Location: Austin, Texas
Default 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

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

Last edited by MrMoke; 04-28-2015 at 02:18 PM.
   
Reply With Quote
Old
RavenOfCode
Senior Member
 
RavenOfCode's Avatar
 
Status: Offline
Posts: 408
Join Date: Oct 2013
Location: Northern Virginia
Default 04-28-2015, 04:32 PM

Quote:
Originally Posted by MrMoke View Post
A large test - oh boy!!!
I hope it's standardized!
I love large standardized tests.

Nothing better for teaching you to become a robot

Oh Yeah- I'm up to version 2 now.
Standardized... i wish... I guess latin isnt so bad... oh wait its horrible... :/


Stuff + Other Stuff + Different Other Stuff = Things :)

My best Alice game:

Clash of the Cubes (an arena fighting game):
http://www.alice.org/community/showthread.php?t=10738&highlight=game
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 04-29-2015, 05:59 AM

Semper ubi sub ubi


(')>
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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