Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #19  
Old 06-15-2014, 10:47 AM
blackbeltben blackbeltben is offline
Registered User
Join Date: Aug 2011
Posts: 83
blackbeltben is on a distinguished road
Quote:
Originally Posted by Jakov_the_Jakovasaur View Post
something like this?

PHP Code:
function isBlocking(tile) {
  
temp.blocktiles = {0,16,1024,1025,1026,1027,1028,1029};
  return
    
tiles[player.1.5player.2in temp.blocktiles ||
    
this.checkBlockNPCs()
  ;
}

function 
checkBlockNPCs() {

  
temp.npcs findareanpcs(player.1.5player.20.06250.0625);

  for (
temp.temp.npcs
    if (
temp.n.blocking)
      return 
true;

  return 
false;

but then im not sure its a good idea to be checking just a single pixel for collisions, graal movement usually checks the width of the players body (2 tiles or 32 pixels)

What are the 0.0625s for?
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:30 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.