Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- node entity
- extends kinematicBody2D
- #vars
- Vector2D position #position in world space
- #methods
- func onHit #activated when a weapon sends hit(),take damage returned by weapon
- func onInteract #activated when character sends interact()
- func onKill #activated when health = 0, or a kill signal is sent, play death animation and dequeue
- --------------------------------------
- node Character
- extends entity
- #vars
- int health
- int speed
- PlayerController input #this class recieves inputs and hands them to a character
- enum physicalState {idle, move, shift, moveandshift} #shift in this case occurs when a certain input is held
- enum specialStates {normal, justice, burst} #justice occurs when passing north of the justice line, burst occurs when the burst button is pressed
- #methods
- func checkStates(): #checks the current state based on input and current variable vals
- if buttonPressed
- physicalState = move;
- if shootPressed #for x amount of frames.
- physicalState = shift;
- if position - justiceLinePos > 0
- specialState = justice
- #etc...
- func onShoot #when shoot button is pressed
- if specialState = normal
- #just shoot
- if specialState = justice
- #use justice shot
- func onBomb #when bomb button is pressed
- func onMove(): #when movement buttons are pressed
- if leftPressed #move left anim
- if rightPressed #move right anim
- #etc...
- --------------------------------------
- node Player
- #methods
- func onShoot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement