SHARE
TWEET

Untitled

a guest Sep 18th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const TEXTURE_PATHS = [
  2.     "res://img/gun_barrel_0.png",
  3.     "res://img/gun_barrel_1.png",
  4.     "res://img/gun_barrel_2.png",
  5.     "res://img/gun_barrel_3.png",
  6.     "res://img/gun_barrel_4.png",
  7.     "res://img/gun_barrel_5.png",
  8.     "res://img/gun_barrel_6.png",
  9. ]
  10. var textures = []
  11.  
  12. func _ready():
  13.     textures.resize(7)
  14.     for i in range(0, 7):
  15.         textures[i] = load(TEXTURE_PATHS[i])
  16.  
  17. func change_sprite_texture(angle):
  18.     var index = ...
  19.     $Sprite.set_texture(textures[index])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top