Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
MP8 game
import java.util.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.Timer; public class Player { public static boolean plive = true; public static boolean SkillupUsed, regen = false; public static boolean castable, inbattle = true; public String pname = "Jerry"; public static int phealth, phealthmax, pmp, pmpmax, gold, pattack, exp, level, expneeded, skillpoints;{ phealth = 1; phealthmax = 100; pmp = 100; pmpmax = 1; gold = 0; pattack = 1; exp = 0; level = 1; expneeded = 100; skillpoints = 0; } public static void checkhealth(){ if (phealth <= 0){ plive = false; } } public static void Levelup(){ if (plive == true){ if (exp == expneeded || exp > expneeded) { level++; exp = exp-expneeded; expneeded*= 1.2; skillpoints++; } } } public static void SkillUp(){ if (plive == true){ if (skillpoints>0 && SkillupUsed == true) skillpoints--; } } ActionListener actListener = new ActionListener(){ public void actionPerformed(ActionEvent Event){ if (phealth<phealthmax && inbattle == false){ phealth+=(phealthmax/1500); System.out.println(phealth); } if (pmp<pmpmax && inbattle == false){ pmp+=(pmpmax/1500); System.out.println(pmp); } regen = true; } }; private static int countdown = 10;{ Timer timer = new Timer(countdown,actListener); if (regen == true && inbattle == false) { timer.start(); System.out.println(timer); } else if (inbattle == true) regen = false; else regen = false; } }
run
|
edit
|
history
|
help
0
update
kochergina_3
H
Coding Challenge - 01 (Even numbers)
BFS in graph
// Java Coding Challenge - 10: Palindrome numbers
1a
1.6
Java messing around
A