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

@ -107,16 +107,6 @@ class BossFragment() : Fragment() {
println(item) println(item)
player.addItem(item) player.addItem(item)
player.gainXp(boss.xpReward) 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 maVue = view.findViewById<View>(R.id.toast)
val image = maVue.findViewById<ImageView>(R.id.imageViewLoot) val image = maVue.findViewById<ImageView>(R.id.imageViewLoot)
val name = maVue.findViewById<TextView>(R.id.nameLoot) val name = maVue.findViewById<TextView>(R.id.nameLoot)
@ -124,11 +114,22 @@ class BossFragment() : Fragment() {
maVue.visibility = View.VISIBLE maVue.visibility = View.VISIBLE
image.setImageResource(item.image) image.setImageResource(item.image)
name.text = item.name name.text = item.name
xp.text = item.xpReward.toString() xp.text = boss.xpReward.toString()
maVue.postDelayed({ maVue.postDelayed({
maVue.visibility = View.GONE maVue.visibility = View.GONE
}, 3000) }, 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 // 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 progressBar.progress = boss.life
} }
} }
} }

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

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

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

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

Loading…
Cancel
Save