User Tools

Site Tools


crpl:crpltutorial:easycrpl

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
crpl:crpltutorial:easycrpl [2015/04/17 04:36] – updated EasyCRPL to version 1.1 Telanircrpl:crpltutorial:easycrpl [2019/05/05 13:13] (current) – Small change for code highlighting Karsten75
Line 5: Line 5:
  
  
-<code> #=============================================+<code 4rpl>#=============================================
 # ===== :EasyCRPL: Collection by Telanir ===== # ===== :EasyCRPL: Collection by Telanir =====
 # --VERSION: 1.1 # --VERSION: 1.1
 # CREDITS: # CREDITS:
-# Big thanks to VirgilW for an amazing game and lots of well commented source! +# Big thanks to Knuckle Cracker (knucracker) for an amazing game and lots of well commented source! 
-# Big thanks to Tyler21 for the Forcefield code!+# Big thanks to Tyler21 for a contribution of Forcefield code using Field cells!
 # #
 # Usage: Simply paste this script at the bottom of your # Usage: Simply paste this script at the bottom of your
Line 64: Line 64:
 # -- # --
 # #
 +# @GetCreeperInRadius: x y f1 - f2
 # @SetImageAlpha: s1 i1 - # @SetImageAlpha: s1 i1 -
 # @TerrainAccessible: x y i1 - b1 # @TerrainAccessible: x y i1 - b1
Line 674: Line 675:
  <-uv_found  <-uv_found
  
 +# Function :GetCreeperInRadius
 +# Returns the SUM of all creeper in a certain square
 +# around an origin. If there is anti-creeper present this
 +# value may go into the negatives.
 +# Notation: x y f1 - f2
 +# eg. CurrentCoords 1 @GetCreeperInRadius ->sumcreepergrid3x3
 +:GetCreeperInRadius
 + ->CR_RAD
 + ->CR_Y
 + ->CR_X
 + 0 ->CR_C
 + <-CR_RAD mul(2) add(1) ->CR_LENGTH
 +
 + <-CR_LENGTH 0 do
 + <-CR_LENGTH 0 do
 + <-CR_Y I add <-CR_RAD sub ->CR_FY
 + <-CR_X J add <-CR_RAD sub ->CR_FX
 + <-CR_FX <-CR_FY GetCreeper add(<-CR_C) ->CR_C
 + loop
 + loop
 +
 + <-CR_C
 +
 # Function: :SetImageAlpha # Function: :SetImageAlpha
 # Sets the alpha of the specified image for self. # Sets the alpha of the specified image for self.
crpl/crpltutorial/easycrpl.1429259793.txt.gz · Last modified: 2015/04/17 04:36 by Telanir