Jump to content


  • Content count

  • Joined

  • Last visited

  1. [quote name='DoseSociety']Lol, what I mean is that his videos teach you bad programming practice and also I dont want to have to review the basics for the 5th time. I want to learn how to become a master programmer not a noob like the people that watch buckies videoes. I already watched them all and got what I'd get out of them. What I'm asking for now is professional education. I'm sorry but your comment is irritating because you don't know what you're talking about.[/QUOTE] well to be honest you probably wont find what youre looking for in a video series(without paying anyhow), you should probably go with a good reference book, such as "Effective Java", that teaches exactly what youre asking for. If you know all the basics and are still a bad programmer you need to learn what good code is and how to put it together. That book will get the job done.
  2. So if you have ever gambled back in the day on rs, youll remember that there were 2 main points of gambling : Dicing and FlowerPoker(there were others but these were by far the most popular) So ive managed to make a flower poker clone(command console) its almost done just have to add a few things, mainly adding together your hands for instance if you get 2 blue flowers and 3 purpless thats a full house... currently in my program there is no way to check hands, im kind of stumped ive tried a few ways cant come up with nothing that works, So if you can offer any help on the matter id greatly appreciate it!(no real point to this just bored and its fun to code lol) Heres my source: [code] import java.util.Random; public class Launcher { public static Random rand = new Random(); public static String[] flowers = {"Pastel","Mixed","Red","Blue","Yellow","Purple","Orange"}; public static String[] rareFlowers = {"Black","White"}; public static String playerFlower, npcFlower, hand; public static int rareTable; public static void main(String[] args){ start(); } public static void start(){ //Player Hand System.out.println("You begin planting..."); System.out.println(randFlower(playerFlower)); System.out.println(randFlower(playerFlower)); System.out.println(randFlower(playerFlower)); System.out.println(randFlower(playerFlower)); System.out.println(randFlower(playerFlower)); //insert player hand here(1P, 2P, Oak, etc... pause(); //Npc Hand System.out.println("Your Oponent will now begin planting..."); System.out.println(randFlower(npcFlower)); System.out.println(randFlower(npcFlower)); System.out.println(randFlower(npcFlower)); System.out.println(randFlower(npcFlower)); System.out.println(randFlower(npcFlower)); } public static String randFlower(String f){ rareTable = 1+ rand.nextInt(100); if(rareTable == 20 || rareTable == 40 || rareTable == 60 || rareTable == 80 || rareTable == 100) { int r = rand.nextInt(rareFlowers.length); pause(); return rareFlowers[r]; } int x = rand.nextInt(flowers.length); pause(); return flowers[x]; } public static void pause(){ try { Thread.sleep(1500); } catch (InterruptedException e) { e.printStackTrace(); } } } [/code]
  3. if you couldnt understand and learn from all his videos you probably shouldnt be programming lol
  4. hands down no question, thenewboston tutorials on youtube. has an advanced and beginner series. good for learning and referencing.
  5. [quote name='Arix'] And to answer your title about ints, they are good. I don't know who told you that the basis of numbers is bad.[/QUOTE] static ints, someone told me if i were to multi thread or run 2 instances of my program on one jvm, then they would change ea others values
  6. [quote name='Hope']It really comes down to preference I guess, unless you're working for someone (company, freelancer) and your client wants it done in a professional way (meaning you'll have to learn when to use and not use static methods). Here's a good simple summation I found on stack overflow: Since Java is object oriented, you should be making classes that represent objects. To me, I view it as all functions pertaining to the instance of the class being called, should NOT be static. Any functions that do arithmetic/some funciton of input (using the parameters passed through) and require no use of object variables within the class, then they SHOULD be static. Ex: [code] class Test { private int num; public int getNum() { return this.num; } public static int getSum(int a, int b) { // we use static since we're not using any member variables ('num' in this case). // this method does pure calculations based on the parameters and has some relation/grouping to the class it's inside of. return a + b; } } [/code] Static is the opposite of dynamic. Would you rather your code be dynamic, upgradeable, and easily changeable in the future, or would you rather it be static (would be tough to change a full application written in static code).[/QUOTE] thanks a lot, your opinion helps a ton
  7. So ive been strengthening my programming skills lately by writing tons of programs, i was looking at some forums and i came across a thread that was having a debate on using Static modifiers... Ive come to rely heavily on them in all my programs and im so confused on why they are/are not bad... Ive read up alot on the subject and my searches always end up with people arguing back and forth and no real definitive answer, so ill ask all the java programmers on this site... Whats the deal with them? Should i not use them at all? Should i use them sparingly? Why are they bad? Im so confused on the subject and admittedly a little discouraged because as ive said before i use them heavily and not using them would wreck my entire programming style, but if they are really bad practice obviously i want to learn how and more importantly why to get rid of them. What do you guys think?? [B]TL;DR [/B]Why are statics bad practice(if they are), should they be used? Thanks guys!
  8. LMAO figured it out forgot a damn liine of code omg noob mistake, if there is anyone with same problem, in your player movement code after you declare the new animation you have to update.(delta), total brain fart CLOSE.
  9. So in order to understand this i think you have to know Slick2D(possibly), so if you don't, you can probably stop reading here. Now for those of you who are familiar here's my problem: so basically i have animations set up in my game, they work fine with one exception, my walking animation consists of 3 frames here is the code i have. [code] walkUp = new Animation(moveUp, duration, true); [/code] Now as you can see in the params i have autoupdating set to true, so it flows through all 3 frames nonstop(problem)because if i stop pressing the movement keys my char marches in place, BUT if i set it to false... the animations dont cycle AT ALL and my char just moves as if he were a block(also a problem), SO how can i fix this in Slick2D. Here is more code: Loads images into an array (the animation): [code] Image[] moveUp ={ new Image("res/char/charU.png"), new Image("res/char/charU2.png"), new Image("res/char/charU3.png")}; [/code] Controls the movement: [code] if(playerInput.isKeyDown(Input.KEY_UP)){ playerMovement = walkUp;charY += delta * .1f;} [/code] i can provide more code if need be, driving me crazy!! thanks!
  10. so my server has no skills in it, i want to rip skills from another server and edit them to my liking, but i need a good base to do this from can anyone recommend a base that has the skills compeleted that i can look at to get a grasp on how its done? [B]OR AT LEAST SHOW ME THE OUTLINE ON HOW TO ADD SKILLS?[/B] Thanks
  11. dont have a clickobject class, i figured something out though. the base im using is really different from whats out there, not alot of people use it because its so bare lol
  12. so for dev purposes, i wanted to know how do you make it to where when i click on something in game it gives me the id of that item in the chat box so i do what i wish with the item id, so that when my players click on that item whatever action i wish to happen will happen... using asteria 2.0 if that matters (also i want this only to happen for admins+) thanks ahead of time lacero
  13. Can anyone recommend a good stable CLEAN(but not totally broken mind you) base to start off with preferably 474 and below? I wanna have a good start but not all that custom junk.. basically a server like the original 2007 osrs... many thanks!!