Jump to content

Lord Nikon

Members
  • Content Count

    507
  • Joined

  • Last visited

Everything posted by Lord Nikon

  1. The busyness and contrast just appeals to me, I'll try a more sudtle approach
  2. Ah no offence taken the renders are from HL2. It's 2 soldiers or whatever shooting at some ugly creatures The creatures are covered up Now what do you think of it to spite the nono relevance to HL2 ?
  3. With Text: Without Text: Which one is better? Comments and Ratings
  4. Here's another variation I took out the highlights on the renders. It looks more bold now
  5. Variation 1: Variation 2: Personally I like number 1 better Comments?
  6. This is the original render: It's from oddworld stranger's wrath
  7. Oh definately nothing is gonna replace my current sig but maybe I should do some more GFX to get in touch =P
  8. It's been like 1 year since I did any GFX. I don't have the same skills I did but this is pretty good What do you think?
  9. It took me 2 minutes to download that Anywho congrats to all the winners but next time it would be better if we could use our skills and stuff
  10. Slurpees are so cheap man, they're bascially just sugar with Ice and maybe some artificial flavouring But it's nice to endulge once in a while I never finish mine though
  11. Hence the thread title Simple C++ Encryption Program
  12. Well basically what this program does to encrypt a string is add 2 to the ASCII value of each character in a string. It's pretty easy to comprehend if you have done any amateur C++ before // Calc.cpp : Defines the entry point for the console application. // #include <iostream> #include <cstdlib> #include <ctime> #include <cstring> #include <string> #include <cctype> using namespace std; void Encrypt(string&); string Decrypt(string strTarget); int main() { //initialize and get the string from the user string strTarget; cout << "Enter a string to encrypt: "; getline(cin,strTarget); string temp(strTarget); Encrypt(strTarget); cout << "Encrypted: " << strTarget << endl; cout << "Decrypted: " << Decrypt(strTarget) << endl; return 0; } void Encrypt(string &strTarget) { int len = strTarget.length(); char a; string strFinal(strTarget); for (int i = 0; i <= (len-1); i++) { a = strTarget.at(i); int b = (int)a; //get the ASCII value of 'a' b += 2; //Mulitply the ASCII value by 2 if (b > 254) { b = 254; } a = (char)b; //Set the new ASCII value back into the char strFinal.insert(i , 1, a); //Insert the new Character back into the string } string strEncrypted(strFinal, 0, len); strTarget = strEncrypted; } string Decrypt(string strTarget) { int len = strTarget.length(); char a; string strFinal(strTarget); for (int i = 0; i <= (len-1); i++) { a = strTarget.at(i); int b = (int)a; b -= 2; a = (char)b; strFinal.insert(i, 1, a); } string strDecrypted(strFinal, 0, len); return strDecrypted; } Copy+Paste into a C++ source file and run it.
  13. I barely ever comment my basically because Im usually the only one to read it If you analyze the srcMain.java file though the OOP in there is pretty straight forward from my point of view. And don't try to understand the GUI coding that's really irrelivent it just builds the GUI thats all.
  14. Here just have the whole project source Battle_Class.zip
  15. Well this is the closest I could get to seeding different numbers But the game doesn't always end in a tie so it works like it should The GUI changed too Well I don't know how to make a exe I attached the JAR file and the library. So don't remove "lib" from the "dist" folder. Battle_Class.zip
  16. Maybe there are things in this that only work for NetBeans. I need to make the Random variable seed to the milliseconds of the host computer before I can release an exe, sorry I'll post it up tomorrow
  17. Most Java compilers can execute this code, I used NetBeans
  18. This is a simple Java class nothing too special about, it simply simulates a battlefield with a warrior and a beast. The ammount of damage they do depends on their level, attack the opponent's defence. frmMain.Java import java.lang.*; import java.util.*; import java.text.*; public class frmMain extends javax.swing.JFrame { public Warrior Me = new Warrior("",0,0,0,0); public Beast Enemy = new Beast("",0,0,0,0); public Battlefield Battle = new Battlefield(Me, Enemy); public frmMain() { initComponents(); } // <editor-fold defaultstate="collapsed" desc=" Generated Code "> private void initComponents() { txtNewName = new javax.swing.JTextField(); jPanel1 = new javax.swing.JPanel(); lblName = new javax.swing.JLabel(); lblAttack = new javax.swing.JLabel(); lblDefence = new javax.swing.JLabel(); lblHealth = new javax.swing.JLabel(); lblLevel = new javax.swing.JLabel(); lblCaption = new javax.swing.JLabel(); jPanel4 = new javax.swing.JPanel(); lblNameEnemy = new javax.swing.JLabel(); lblAttackEnemy = new javax.swing.JLabel(); lblHealthEnemy = new javax.swing.JLabel(); lblDefenceEnemy = new javax.swing.JLabel(); lblLevelEnemy = new javax.swing.JLabel(); cmdDoBattle = new javax.swing.JButton(); cmdBattle = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); lblWarriorScore = new javax.swing.JLabel(); lblBeastScore = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Battle Class"); setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); setResizable(false); txtNewName.setFont(new java.awt.Font("Tahoma", 0, 11)); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Your Stats")); jPanel1.setFont(new java.awt.Font("Tahoma", 0, 11)); lblName.setFont(new java.awt.Font("Tahoma", 0, 11)); lblName.setText("Name:"); lblAttack.setFont(new java.awt.Font("Tahoma", 0, 11)); lblAttack.setText("Attack: 0"); lblDefence.setFont(new java.awt.Font("Tahoma", 0, 11)); lblDefence.setText("Defence: 0"); lblHealth.setFont(new java.awt.Font("Tahoma", 0, 11)); lblHealth.setText("Health:"); lblLevel.setFont(new java.awt.Font("Tahoma", 0, 11)); lblLevel.setText("Level: 0"); org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup() .addContainerGap() .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(lblName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE) .add(lblLevel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 162, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblAttack, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 162, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblDefence, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 162, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(org.jdesktop.layout.GroupLayout.TRAILING, lblHealth, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 162, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup() .add(lblName) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(lblLevel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(lblAttack) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(lblDefence) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(lblHealth)) ); lblCaption.setFont(new java.awt.Font("Tahoma", 0, 11)); lblCaption.setText("Name:"); jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Enemy Stats")); jPanel4.setFont(new java.awt.Font("Tahoma", 0, 11)); lblNameEnemy.setFont(new java.awt.Font("Tahoma", 0, 11)); lblNameEnemy.setText("Name:"); lblAttackEnemy.setFont(new java.awt.Font("Tahoma", 0, 11)); lblAttackEnemy.setText("Attack: 0"); lblHealthEnemy.setFont(new java.awt.Font("Tahoma", 0, 11)); lblHealthEnemy.setText("Health:"); lblDefenceEnemy.setFont(new java.awt.Font("Tahoma", 0, 11)); lblDefenceEnemy.setText("Defence: 0"); lblLevelEnemy.setFont(new java.awt.Font("Tahoma", 0, 11)); lblLevelEnemy.setText("Level: 0"); org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .addContainerGap() .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(lblNameEnemy) .add(lblLevelEnemy, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 162, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblAttackEnemy, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE) .add(lblDefenceEnemy, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE) .add(lblHealthEnemy, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE)) .addContainerGap()) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel4Layout.createSequentialGroup() .add(lblNameEnemy) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(lblLevelEnemy) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(lblAttackEnemy) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(lblDefenceEnemy) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(lblHealthEnemy) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); cmdDoBattle.setFont(new java.awt.Font("Tahoma", 0, 10)); cmdDoBattle.setText("Start"); cmdDoBattle.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cmdDoBattleActionPerformed(evt); } }); cmdBattle.setFont(new java.awt.Font("Tahoma", 0, 10)); cmdBattle.setText("Do Battle!"); cmdBattle.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cmdBattleActionPerformed(evt); } }); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Score Board")); lblWarriorScore.setFont(new java.awt.Font("Tahoma", 0, 11)); lblWarriorScore.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); lblWarriorScore.setText("Warrior: 0"); lblBeastScore.setFont(new java.awt.Font("Tahoma", 0, 11)); lblBeastScore.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); lblBeastScore.setText("Beast: 0"); org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createSequentialGroup() .addContainerGap() .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(org.jdesktop.layout.GroupLayout.LEADING, lblBeastScore, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.LEADING, lblWarriorScore, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2Layout.createSequentialGroup() .add(lblWarriorScore) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(lblBeastScore)) ); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() .add(lblCaption) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(txtNewName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 155, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 21, Short.MAX_VALUE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(cmdDoBattle) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(cmdBattle)) .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)) .add(7, 7, 7) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(cmdDoBattle) .add(cmdBattle) .add(lblCaption) .add(txtNewName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(16, Short.MAX_VALUE)) ); pack(); }// </editor-fold> private void cmdBattleActionPerformed(java.awt.event.ActionEvent evt) { Battle.DoBattle(); LoadStats(); } private void cmdDoBattleActionPerformed(java.awt.event.ActionEvent evt) { Me.setName(txtNewName.getText()); Me.setAttack(50); Me.setDefence(20); Me.setHealth(500); Me.setLevel(5); Enemy.setName("Cobra"); Enemy.setAttack(50); Enemy.setDefence(20); Enemy.setHealth(500); Enemy.setLevel(5); this. LoadStats(); //DateFormat timeFormatter = DateFormat.getTimeInstance(DateFormat.DEFAULT, currentLocale); txtNewName.setText(String.valueOf(DateFormat.SECOND_FIELD)); } void LoadStats(){ //Load warrior stats lblName.setText("Name: " + Me.getName()); lblHealth.setText("Health: " + String.valueOf(Me.getHealth()) + "/500"); lblAttack.setText("Attack: " + String.valueOf(Me.getAttack())); lblDefence.setText("Defence: " + String.valueOf(Me.getDefence())); lblLevel.setText("Level: " + String.valueOf(Me.getLevel())); lblWarriorScore.setText(Me.getName() + ":" + String.valueOf(Battle.getWarriorScore())); //Load beast stats lblNameEnemy.setText("Name: " + Enemy.getName()); lblHealthEnemy.setText("Health: " + String.valueOf(Enemy.getHealth()) + " /500"); lblAttackEnemy.setText("Attack: " + String.valueOf(Enemy.getAttack())); lblDefenceEnemy.setText("Defence: " + String.valueOf(Enemy.getDefence())); lblLevelEnemy.setText("Level: " + String.valueOf(Enemy.getLevel())); lblBeastScore.setText(Enemy.getName() + ":" + String.valueOf(Battle.getBeastScore())); } public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new frmMain().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton cmdBattle; private javax.swing.JButton cmdDoBattle; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel4; private javax.swing.JLabel lblAttack; private javax.swing.JLabel lblAttackEnemy; private javax.swing.JLabel lblBeastScore; private javax.swing.JLabel lblCaption; private javax.swing.JLabel lblDefence; private javax.swing.JLabel lblDefenceEnemy; private javax.swing.JLabel lblHealth; private javax.swing.JLabel lblHealthEnemy; private javax.swing.JLabel lblLevel; private javax.swing.JLabel lblLevelEnemy; private javax.swing.JLabel lblName; private javax.swing.JLabel lblNameEnemy; private javax.swing.JLabel lblWarriorScore; private javax.swing.JTextField txtNewName; // End of variables declaration } scrMain.Java import java.lang.*; import java.util.*; import java.text.*; import java.sql.*; class Battlefield { private Warrior cWarrior; private Beast cBeast; private int WarriorScore; private int BeastScore; Battlefield(Warrior eNewWarrior, Beast eNewBeast){ cWarrior = eNewWarrior; cBeast = eNewBeast; } public void DoBattle(){ int WarriorDamage = (cWarrior.getAttack() * Rand(cWarrior.getLevel())) - cBeast.getDefence(); int BeastDamage = (cBeast.getAttack() * Rand(cBeast.getLevel())) - cWarrior.getDefence(); cWarrior.setHealth(cWarrior.getHealth() - BeastDamage); cBeast.setHealth(cBeast.getHealth() - WarriorDamage); if (cWarrior.getHealth() <= 0){ cWarrior.setLevel(cWarrior.getLevel() + 1); setWarriorScore(getWarriorScore() + 1); cWarrior.setHealth(500); } if (cBeast.getHealth() <= 0) { cBeast.setLevel(cBeast.getLevel() + 1); setBeastScore(getBeastScore() + 1); cBeast.setHealth(500); } } private int Rand(int intMax){ Random rnd = new Random(); return rnd.nextInt(intMax); } public int getWarriorScore(){ return WarriorScore; } public int getBeastScore(){ return BeastScore; } public void setWarriorScore(int eVal){ WarriorScore = eVal; } public void setBeastScore(int eVal){ BeastScore = eVal; } } class Warrior { private String Name; private int Health; private int Attack; private int Defence; private int Level; Warrior(String eName,int eLevel, int eHealth, int eAttack, int eDefence){ Name = eName; Level = eLevel; Health = eHealth; Attack = eAttack; Defence = eDefence; } //All get constructors public String getName(){ return Name; } public int getLevel(){ return Level; } public int getHealth(){ return Health; } public int getAttack(){ return Attack; } public int getDefence(){ return Defence; } //All set constructors public void setName(String eVal){ Name = eVal; } public void setLevel(int eVal){ Level = eVal; } public void setHealth(int eVal){ Health = eVal; } public void setAttack(int eVal){ Attack = eVal; } public void setDefence(int eVal){ Defence = eVal; } } class Beast { private String Name; private int Health; private int Attack; private int Defence; private int Level; Beast(String eName,int eLevel, int eHealth, int eAttack, int eDefence){ Name = eName; Level = eLevel; Health = eHealth; Attack = eAttack; Defence = eDefence; } //All get constructors public String getName(){ return Name; } public int getLevel(){ return Level; } public int getHealth(){ return Health; } public int getAttack(){ return Attack; } public int getDefence(){ return Defence; } //All set constructors public void setName(String eVal){ Name = eVal; } public void setLevel(int eVal){ Level = eVal; } public void setHealth(int eVal){ Health = eVal; } public void setAttack(int eVal){ Attack = eVal; } public void setDefence(int eVal){ Defence = eVal; } } Screenie: Questions or comments?
  19. Photoshop elements is like a disabled version of CS but it's still excellent for almost everything. Since we don't have any tuts for element try googling it for yourself. I've seen great sigs and stuff made by element so don't think you have to get CS.
  20. Opera-Faster than firefox and the tango skin looks awsome Microsoft Visual Basic 6-Program in vb6 Microsoft Visual C++ 6-Program in C++ Microsoft Visual Basic .NET-Program in VB6 and use the .NET software development kit Microsoft Visual C# .NET-Program in C# and use .NET great program for any programmer Mozilla Thunderbird-Email utility Netbeans-Used for java programming
  21. Name: David Country: Canada Posts: 430 Reffered by: lukerman
  22. Ya I would say they're real, in most games if you're well skilled disassemblers you can change vars and stuff to walk through walls and stuff.
  23. Ya Im guessing your Cable is loose. But this happens to me sometimes and I just do a restart to fix it. Try going to Control Panel>>Network and Internet Connections>>Network Connections Then from there decide which one is timed out. To find out which one is timed out see which connection icon says "disconnected" in it. Then right click on that icon and choose "Repair" from the menu. If all goes well the LAN connection will be online again and your internet will work. Otherwise restart your computer. Another reason this happens is if your cable is over 20-25 ft long so try getting a shorter cable.
  24. Just read up on the required skills I read an eBook on SQL injections and passed one of the levels Some of them just beg for programming skills
×
×
  • Create New...