(request)make an npc cliffturn once an additional setting is triggered

Description: Have idea for a script, but you can't make it? Post it here!
Moderators: Lx Xzit, Yoshi021, 5438A38A, Semi-moderatos, Moderators

BolanoGustavo
Topic author, Our friend
Our friend
BolanoGustavo
Topic author, Our friend
Our friend
Reputation: 10
Posts: 78
Joined: 18 Aug 2016

Post #1by BolanoGustavo » 25 Mar 2021, 22:22

make an npc by changing its facing can put at least one advset without using an iterator. That is, when an npc once cliffturn an advset is activated, something similar to some enemies in the Mario universe. For example, the fifth row sprites
Attachments
143271.png

coolXD
Honourable citizen
Honourable citizen
coolXD
Honourable citizen
Honourable citizen
Reputation: 32
Posts: 43
Joined: 13 Jan 2020

Post #2by coolXD » 26 Mar 2021, 5:45

This with extx npc once cliffturn code.

Code: Select all

dim iterator as double
dim iteratornext as double

With npc(sysval(param1))

'Gravity
.ysp = .ysp + 0.26
if .ysp > 8 then .ysp = 8

'Cliffturn
If .stand = 1 then
   If .facing = 1 then
      iterator = itrcreate(1, 0, .x+22*.width/64, .y+.height-10, 10*.width/64, 20)
   Else
      iterator = itrcreate(1, 0, .x+.width-32*.width/64, .y+.height-10, 10*.width/64, 20)
   End if
   
   Do
   iteratornext = itrnext(iterator)
   If iteratornext = 0 Then Exit do
     
   If block(iteratornext).state = 0 then
      iteratornext = 1
   Exit do
   End if
   Loop   

   If iteratornext = 0 then
      .facing = 1 - .facing
   End if

Call berase(0, iterator)
End if

End with

Created Script by NESTED ERNEST


Return to “Script requests”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest