Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- A basic encounter script skeleton you can copy and modify for your own creations.
- music = "mus_battle1"
- encountertext = "Vegetoid came out of\rthe earth!"
- nextwaves = {"bullettest_chaserorb", "bullettest_boucy"}
- wavetimer = 4.0
- arenasize = {155, 130}
- enemies = { "Vegetoid" }
- enemypositions = {
- {0, 50},
- {-70, 30},
- {70, 30}
- }
- -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
- possible_attacks = {"bullettest_bouncy", "bullettest_chaserorb", "bullettest_touhou"}
- function EncounterStarting()
- end
- function EnemyDialogueStarting()
- end
- function EnemyDialogueEnding()
- -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
- -- This example line below takes a random attack from 'possible_attacks'.
- nextwaves = { possible_attacks[math.random(#possible_attacks)] }
- end
- function DefenseEnding() --This built-in function fires after the defense round ends.
- encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy.
- end
- function HandleSpare()
- State("ENEMYDIALOGUE") --By default, pressing spare only spares the enemies but stays in the menu. Changing state happens here.
- end
- function HandleItem(ItemID)
- BattleDialog({"Selected item " .. ItemID .. "."})
- end
- if enemies[1].isSpared == true then
- SetSprite("Vegetoid4")
- else
- animationFrames = {"Vegetoid1", "Vegetoid2", "Vegetoid1", "Vegetoid4"}
- currentFrame = 1
- animationTimer = 0
- function Update()
- animationTimer = animationTimer + 1
- if(animationTimer%20 == 0) then
- currentFrame = (currentFrame % (#animationFrames)) + 1
- animationTimer = 0
- enemies[1].SetSprite(animationFrames[currentFrame])
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement