Cyber Syndicate
<center><p style='font-size:120%;'><strong>Welcome to Cyber Syndicate!<strong></p>

You are visiting as a guest; please <strong>register</strong> or <strong>log in</strong>.

Being logged in provides many benefits, including access to the useful <strong>Methods forum</strong>, posting permissions, and voting permissions.

<strong>Enjoy.</strong></center>



 
HomeFAQUsergroupsRegisterLog in

Share
 

 Multiple classes, need help.

Go down 
AuthorMessage
Letalas
Member
Member


Posts : 5
Join date : 2011-02-25

Multiple classes, need help. Empty
PostSubject: Multiple classes, need help.   Multiple classes, need help. Icon_minitimeFri Mar 25, 2011 10:30 pm

Okay, so I am playing with breaking my script up heavily as I probably should have always done and I am trying to improve my methods.

Anyway; every class is basically like


Code:
package thescript;

public class Constants {
   public static final int B0X_B0X = 1337;
}

And here is what I am thinking, and need suggestions on....
Main
Constants
Settings <- Best way to set this one up? (These are settings determined at the start/gui)
Mouse Control <- Handles all actual mouse clicks
Camera Control <- Handles all actual camera movement
Antiban
Utility <- Has many methods used in multiple classes
State <- enum

Currently the way I been doing it is basically having the control's on their own looptask doing a getState, which would hold information on the current instruction, while the main script sets state. I know there has to be better ways to do this. I come here for help =)
Back to top Go down
View user profile
b0xb0x
Administrator
Administrator


Posts : 130
Join date : 2011-02-25
Age : 23
Location : California

Multiple classes, need help. Empty
PostSubject: Re: Multiple classes, need help.   Multiple classes, need help. Icon_minitimeSat Mar 26, 2011 7:17 am

Nice constant xD

Yeah LoopTask is pretty useful, but maybe you could extend ActiveScript in each subclass and then each class extending it could have its own onStart(), loop(), and onFinish(). I'm not sure if you can do that but it's worth a try.
Back to top Go down
View user profile http://cybersyndicate.forumotion.com
TaffTech
Administrator
Administrator


Posts : 72
Join date : 2011-02-27

Multiple classes, need help. Empty
PostSubject: Re: Multiple classes, need help.   Multiple classes, need help. Icon_minitimeSun Mar 27, 2011 4:01 am

Main = public class Main extends ActiveScript implements PaintListener, MessageListener etc...
Settings = public class Settings
Mouse Control = public class MyMouse extends LoopTask
Camera Control = public class MyCamera extends LoopTask
Antiban = public class Antiban extends LoopTask
Utility = public class Utilities
State(I'd have them in the main class)

Personally I only have seperate classes for things that will be used in different scripts (Antiban, Utilities, Skill Monitor, Graphics methods etc)...

Hopefully this helps, otherwise, I'll give it another go Very Happy
Back to top Go down
View user profile
Sponsored content




Multiple classes, need help. Empty
PostSubject: Re: Multiple classes, need help.   Multiple classes, need help. Icon_minitime

Back to top Go down
 
Multiple classes, need help.
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Cyber Syndicate :: Development :: Scripting Help-
Jump to: