mirror of https://github.com/pret/pokeemerald.git
Updated Implementing Catch EXP (markdown)
parent
e9e6db003c
commit
f519326a50
|
@ -269,11 +269,11 @@ How does leveling up...
|
|||
|
||||
...in battle...
|
||||
|
||||
It... It's a script command. It's *always* a script command.
|
||||
It... It's a script command. Battles use tons of scripting; the script commands are always a good first place to look for things.
|
||||
|
||||
## Let's look at `drawlvlupbox`
|
||||
|
||||
The `BattleScript_LevelUp` script in [`data/battle_scripts_1.s`](https://github.com/pret/pokeemerald/blob/master/data/battle_scripts_1.s) calls the `drawlvlupbox` function whether or not we've leveled up. The `Cmd_drawlvlupbox` function is very similar to `getexp`: it's another one of those commands that runs itself over and over in order to divide its work up across multiple frames. We can see that it sets a bunch of variables that look like `gBattle_BG2_Y`. I guess the battle engine checks these variables on every frame and uses them to decide where the four BG layers should be shifted to. It's probably meant as a way to let move animations easily manipulate graphics on the BG layers.
|
||||
The `BattleScript_LevelUp` script in [`data/battle_scripts_1.s`](https://github.com/pret/pokeemerald/blob/master/data/battle_scripts_1.s) calls the `drawlvlupbox` function. The `Cmd_drawlvlupbox` function is very similar to `getexp`: it's another one of those commands that runs itself over and over in order to divide its work up across multiple frames. We can see that it sets a bunch of variables that look like `gBattle_BG2_Y`. I guess the battle engine checks these variables on every frame and uses them to decide where the four BG layers should be shifted to. It's probably meant as a way to let move animations easily manipulate graphics on the BG layers.
|
||||
|
||||
Why is `drawlvlupbox` shifting a BG layer, though, I wonder? Well, PRET left this handy-dandy code comment in `Cmd_drawlvlupbox`:
|
||||
|
||||
|
|
Loading…
Reference in New Issue