RSC

Please login or register.

Login with username, password and session length
Advanced search  

News:

Join Our Discord: https://discord.gg/ESkVEnq

Pages: [1] 2 3
 1 
 on: August 22, 2017, 04:50:09 PM 
Started by Rodgerwilco - Last post by Bl0ds
Hello! Decided to join here aswell  :)

 2 
 on: August 12, 2017, 10:43:06 AM 
Started by Rodgerwilco - Last post by Fabrice L
Great, let's hope this doesn't become a flaming community ;)

 3 
 on: August 12, 2017, 04:11:08 AM 
Started by Rodgerwilco - Last post by camhart
Thanks for these.  At some point I'll get around to working on my own server again...

 4 
 on: August 05, 2017, 08:05:00 AM 
Started by Rodgerwilco - Last post by Rodgerwilco
Eckos RSC dump: http://rscdump.com/

Servers & Clients
BeyondRSC (Server & Client Package): https://ufile.io/acp1e
RSCAftermath (Server & Client Package): https://ufile.io/1ytn7
KING-PK (Server & Client Package): https://ufile.io/e5c8t
Brutal Pkers 2013 (Server & Client Package)

Tools:
RSCAngelDrop Editor: https://ufile.io/6notp
Sprite View Renderer: https://ufile.io/ujn8p
RSC Map Generator: https://ufile.io/2y1nl
Sprite Editor: https://ufile.io/3ge0s
2D Landscape Editor: https://ufile.io/ufj4b

 5 
 on: August 01, 2017, 08:17:09 PM 
Started by hikilaka - Last post by Rodgerwilco
Sell you 100 for R2h

 6 
 on: August 01, 2017, 07:30:42 AM 
Started by Rodgerwilco - Last post by Rodgerwilco
Information about primitive data types can be found here: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html

The goal of this tutorial is to show you how to use them.

If we were to create an object named Player and wanted to store data about that Player, you would use primitive data types. The type is chosen by memory limitations. An unsigned (non negative) byte for example has a maximum value of 255. Short 65535, Integer 2,147,483,647 and Long 9,223,372,036,854,775,807. In the nuts and bolts tutorial provided you will notice there are more than the four I have mentioned, feel free to use them!
 
When you're designing/brainstorming the contents of an object, you're going to want to figure out what variables your object will have. In our scenario we have a Player and it's up to your imagination to implement whatever the hell you want. For this example I will be implementing the use of 4 variables: kills, deaths, money and a boolean skulled.

Code: (java) [Select]
public class Player{

       private short kills; //(we might have more than 255 kills but no more than 65,535)
       private short deaths;
       private int money;
       private boolean skulled;

       //noargs constructor
       public Player(){

       }
}

We are not required to set the value of our variables because data types have default values. However we do have two options on how we want to assign a value to the variables. We can either create a constructor with assigned values such as:

Code: (java) [Select]
       public Player(short kills, short deaths, int money, boolean skulled){
              this.kills = kills;
              this.deaths = deaths;
              this.money = money;
              this.skulled = skulled;
       }

or we can use a setter to set the value after the object has been created. For example:

Code: (java) [Select]
public class Player{

       private short kills; //(we might have more than 255 kills but no more than 65,535)
       private short deaths;
       private int money;
       private boolean skulled;

       //noargs constructor
       public Player(){

       }

       public void setKills(Short amount){
             this.kills = amount;
       }

       public void setDeaths(Short amount){
             this.deaths = amount;
       }

       public void setMoney(int amount){
              this.money = amount;
       }

       public void setSkulled(boolean skulled){
              this.skulled = skulled;
       }
}

Testing the code above would look something like this:

Code: (java) [Select]
public static void main(String[] args) {
Player p = new Player();
                p.setKills(5);
                p.setDeaths(3);
                p.setMoney(25000);
                p.setSkulled(true);
}

 7 
 on: August 01, 2017, 05:40:28 AM 
Started by Rodgerwilco - Last post by Rodgerwilco
Join us! or not...

 8 
 on: August 01, 2017, 04:32:24 AM 
Started by Rodgerwilco - Last post by Rodgerwilco
I was thinking legends cape  8)

 9 
 on: July 31, 2017, 10:20:55 PM 
Started by Rodgerwilco - Last post by misterhat
Wow, what a thorough and enlightening tutorial!
Yeah, it's very informative. I have not used JAVA in so long, I had forgotten its syntax! LOL  :P

 10 
 on: July 31, 2017, 09:43:45 PM 
Started by Rodgerwilco - Last post by Steven_Tolar
Wow, what a thorough and enlightening tutorial!

Pages: [1] 2 3