SQLite
Lucas Delanier 2 years ago
parent 8aa241e9b4
commit 2e6192f967

@ -107,16 +107,6 @@ class BossFragment() : Fragment() {
println(item)
player.addItem(item)
player.gainXp(boss.xpReward)
boss = Generator.generateBoss()
println(boss)
imageView.setImageResource(boss.image)
val vibrator = context?.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator
vibrator.vibrate(100)
progressBar.max = boss.maxlife
with(recyclerView) {
layoutManager = LinearLayoutManager(view.context)
adapter = AdapterBossLoot(boss.possibleLoot)
}
val maVue = view.findViewById<View>(R.id.toast)
val image = maVue.findViewById<ImageView>(R.id.imageViewLoot)
val name = maVue.findViewById<TextView>(R.id.nameLoot)
@ -124,11 +114,22 @@ class BossFragment() : Fragment() {
maVue.visibility = View.VISIBLE
image.setImageResource(item.image)
name.text = item.name
xp.text = item.xpReward.toString()
xp.text = boss.xpReward.toString()
maVue.postDelayed({
maVue.visibility = View.GONE
}, 3000)
boss = Generator.generateBoss()
println(boss)
imageView.setImageResource(boss.image)
val vibrator = context?.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator
vibrator.vibrate(100)
progressBar.max = boss.maxlife
with(recyclerView) {
layoutManager = LinearLayoutManager(view.context)
adapter = AdapterBossLoot(boss.possibleLoot)
}
// Définissez la propriété scaleX et scaleY de l'image sur 0.5f
@ -143,6 +144,8 @@ class BossFragment() : Fragment() {
progressBar.progress = boss.life
}
}
}

@ -29,6 +29,7 @@ class MainActivity : AppCompatActivity() {
controller.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
}
}
private lateinit var bottomNav : BottomNavigationView

@ -8,37 +8,37 @@ class Player(val pseudo: String, var xp: Int = 0) {
fun changeRank(){
if(this.level<2){
if(this.level<=2){
this.rank = "Beginner"
}
else if(this.level<5){
else if(this.level<=5){
this.rank = "Intermediate"
}
else if(this.level<8){
else if(this.level<=8){
this.rank = "Proficient"
}
else if(this.level<11){
else if(this.level<=11){
this.rank = "Expert"
}
else if(this.level<14){
else if(this.level<=14){
this.rank = "Master"
}
else if(this.level<17){
else if(this.level<=17){
this.rank = "Professional"
}
else if(this.level<20){
else if(this.level<=20){
this.rank = "Champion"
}
else if(this.level<23){
else if(this.level<=23){
this.rank = "Beginner"
}
else if(this.level<26){
else if(this.level<=26){
this.rank = "Legend"
}
else if(this.level<26){
else if(this.level<=26){
this.rank = "Invincible"
}
else if(this.level<29){
else if(this.level<=29){
this.rank = "Divine"
}
}

@ -1,13 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="@color/grey_100" />
</shape>
</item>
<item android:top="2dp" >
<shape android:shape="rectangle">
<solid android:color="@color/black_800" />
</shape>
</item>
</layer-list>

@ -19,6 +19,7 @@
app:menu="@menu/nav_menu"
app:itemIconTint="@drawable/botom_nav_colors"
app:itemTextColor="@drawable/botom_nav_colors"
/>
<fragment

Loading…
Cancel
Save