Author Topic: Sprite(or coding) problem  (Read 3239 times)

0 Members and 1 Guest are viewing this topic.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Sprite(or coding) problem
« on: September 27, 2011, 07:45:30 pm »
So, I was just messing around with Axe again, and I couldn't get this:
Whenever I press 2nd, the bar decreases as it's on air, and when the bar is depleted, stick should go back to running animation.
The problem is: how do I make it happen? I know why the sprite is disappearing, but I don't know how to fix it. XP

Screenshot to see the problem visually.


Spoiler For code:
Code: [Select]
:.ARUN
:prgmθθ
:[000C3D8E50380402]→Str1
:[000C1C2C1328C404
:[000C0C1830103050
:[000C1C2C1328C404
:[0C4D3E10102C2240
:[7EFFFFFFE7662442→Str2
:[000E314040310E00
:[00708C02028C7000
:[7EFFFFFFFF7E3C7E→Str3
:[000E3F7F7F3F0E00
:[0070FCFEFEFC7000
:0→A→C→M
:4→S
:20→J
:Repeat getKey(15)
:¦ If A=4:0→A:End
:C+S→C
:ClrDraw
:ClrDrawr
:
:Pt-Off(70-C,48,Str2)
:Pt-Off(70-C,48,Str3)r
:Pt-Off(135-C,48,Str3)r
:Pt-Off(135-C,48,Str2)
:Pt-Off(210-C,48,Str2)
:Pt-Off(210-C,48,Str3)r
:Pt-Off(3223-C,48,Str2)
:Pt-Off(3223-C,48,Str3)r
:Line(0,56,94,56
:Line(0,56,94,56)r
:Pt-Off(80-C,10,Str2+8)
:Pt-Off(80-C,10,Str3+8)r
:Pt-Off(88-C,10,Str2+16
:Pt-Off(88-C,10,Str3+16)r
:Pt-Off(250-C,18,Str2+8
:Pt-Off(250-C,18,Str3+8)r
:Pt-Off(258-C,18,Str2+16
:Pt-Off(258-C,18,Str3+16)r
:Pt-Off(305-C,48,Str4
:Pt-Off(305-C,48,Str5)r
:Pt-Off(313-C,40,Str5
:Pt-Off(313-C,40,Str4)r
:Pt-Off(313-C,48,Str4+16
:Pt-Off(313-C,48,Str5+16)r
:Pt-Off(321-C,48,Str4+16
:Pt-Off(321-C,48,Str5+16)r
:Pt-Off(321-C,40,Str5+8
:Pt-Off(321-C,40,Str4+8)r
:Pt-Off(329-C,48,Str4+8
:Pt-Off(329-C,48,Str5+8)r
:Line(2,2,2,4
:Line(2,2,20,2
:Line(20,2,20,4
:Line(2,4,20,4
:Line(3,3,J-1,3
:Line(3,3,J-1,3)r
:!If getKey(54)
:Pt-Change(10,48,8*A+Str1
:Pt-Change(10,48,8*A+Str1)r
:!If J=20
:J+1→J
:End
:End
:If getKey(54) and (J>4)
:Pt-Change(10,40,32+Str1)r
:Pt-Change(10,40,32+Str1)
:J-1→J
:End
:If getKey(2):S-1→S:End
:If getKey(3):S+1→S:End
:If S<2:2→S:End
:If S>40:40→S:End
:
:A+1→A
:If A=4:0→A:M+1→M:End
:DispGraphrr
:Pause 70
:End
Sig wipe!

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Sprite(or coding) problem
« Reply #1 on: September 27, 2011, 07:52:14 pm »
ohhh. easy (i think)

easyies way to explain is by telling you.  Hold down 2nd while jumping and you should see.
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Sprite(or coding) problem
« Reply #2 on: September 27, 2011, 07:52:38 pm »
You have 2 conditions for displaying the sprite correct?  The first condition is :!If getKey(54), under which it will display the person on the floor. Under the condition :If getKey(54) and (J>4) the person will be displayed in the air.  Now, when neither of these conditions are met, the person is not displayed at all.  Do you see when this happens?

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Sprite(or coding) problem
« Reply #3 on: September 27, 2011, 07:56:05 pm »
yea, I got that. But I don't know what to do XP
Sig wipe!

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Sprite(or coding) problem
« Reply #4 on: September 27, 2011, 07:58:32 pm »
:If getKey(54) and (J>4)
:Pt-Change(10,40,32+Str1)r
:Pt-Change(10,40,32+Str1)
:J-1→J
:End

to

:If getKey(54)*not(Q) and (J>4)
:1->Q
:end
:if Q
:Pt-Change(10,40,32+Str1)r
:Pt-Change(10,40,32+Str1)
:!If J-1→J
:->Q
:End
:End

« Last Edit: September 27, 2011, 08:26:26 pm by Happybobjr »
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Sprite(or coding) problem
« Reply #5 on: September 27, 2011, 08:00:16 pm »
Well we need to update the conditions, because what happens when the player is pressing 2nd but he is out of power?  He should be on the ground right?  Currently though there is no condition to handle this.  Adding this condition, or modifying the current conditions, would help make this work. 

EDIT:  Happybobjr, won't that make it possible for the player to be in the air even when 2nd is not being held?
« Last Edit: September 27, 2011, 08:01:52 pm by Builderboy »

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Sprite(or coding) problem
« Reply #6 on: September 27, 2011, 08:26:48 pm »
not anymore.  good catch.
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________