Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(evt.getKey() == Key.LeftArrow){
- if(player.hasAttribute("mateselect")){
- Npc[] npcs = (Npc[])player.getAttribute("npcs");
- int currentnpc = (Integer)player.getAttribute("currentnpc");
- currentnpc--;
- if(currentnpc==-1){
- currentnpc=npcs.length-1;
- Npc npc = (Npc)npcs[currentnpc];
- updateheartposition(player, npc);
- player.setAttribute("currentnpc", currentnpc);
- return;
- }if(currentnpc>=0){
- Npc npc = (Npc)npcs[currentnpc];
- updateheartposition(player, npc);
- player.setAttribute("currentnpc", currentnpc);
- }
- }
- }if(evt.getKey() == Key.RightArrow){
- if(player.hasAttribute("mateselect")){
- Npc[] npcs = (Npc[])player.getAttribute("npcs");
- int currentnpc = (Integer)player.getAttribute("currentnpc");
- currentnpc++;
- if(currentnpc==npcs.length){
- currentnpc=0;
- Npc npc = (Npc)npcs[currentnpc];
- updateheartposition(player, npc);
- player.setAttribute("currentnpc", currentnpc);
- }if(currentnpc<=npcs.length-1){
- Npc npc = (Npc)npcs[currentnpc];
- updateheartposition(player, npc);
- player.setAttribute("currentnpc", currentnpc);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement