Game Code Issue

Advanced game related topics
User avatar
J. Baker
Addict
Addict
Posts: 2196
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Game Code Issue

Post by J. Baker »

The following code works except if BoardPush does not equal 3. It just pauses in the AnimateSprite() instead of clipping it. It's the Else that it doesn't seem to get. If I remove lines 2 and 4 it works. But not like I want it to. I also can not get And to work in games either but that's a whole different issue.

Code: Select all

If KeyboardPushed(#PB_Key_Right) Or JoystickAxisX(0) = 1
  If BoardPush = 3
     AnimateSprite(49, 128, 128, 4, 1, 14, 1)
  EndIf
Else
     ClipSprite(49, 256, 384, 128, 128)
EndIf
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
User avatar
J. Baker
Addict
Addict
Posts: 2196
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: Game Code Issue

Post by J. Baker »

I got it. I swear, I can have an issue drive me crazy for days. As soon as I ask on the forum, I figure it out. :oops:

Code: Select all

If KeyboardPushed(#PB_Key_Right) Or JoystickAxisX(0) = 1
  If BoardPush = 3
     AnimateSprite(49, 128, 128, 4, 1, 14, 1)
   Else
     ClipSprite(49, 256, 384, 128, 128)
   EndIf
EndIf
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Re: Game Code Issue

Post by Rook Zimbabwe »

Small reccomend you usse the numpad or the QWEASDZXC (for left handed peeps)
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
User avatar
J. Baker
Addict
Addict
Posts: 2196
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: Game Code Issue

Post by J. Baker »

Rook Zimbabwe wrote:Small reccomend you usse the numpad or the QWEASDZXC (for left handed peeps)
Good recommendation, will do. ;)
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Game Code Issue

Post by PB »

> I can have an issue drive me crazy for days. As soon as I ask on the forum, I figure it out

So true! It's happened to me so often now, that sometimes I just ask
on the forums immediately so I don't waste days trying to work it out.
There's definitely something about asking the question that makes you
work out what you've done wrong. Someone in the forums had a phrase
for it, but I can't remember what it is right now.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
J. Baker
Addict
Addict
Posts: 2196
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: Game Code Issue

Post by J. Baker »

PB wrote:> I can have an issue drive me crazy for days. As soon as I ask on the forum, I figure it out

So true! It's happened to me so often now, that sometimes I just ask
on the forums immediately so I don't waste days trying to work it out.
There's definitely something about asking the question that makes you
work out what you've done wrong. Someone in the forums had a phrase
for it, but I can't remember what it is right now.
Maybe I should take more breaks. An over-worked mind can make mistakes easily. But good idea, next time I'll ask sooner. ;)
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Game Code Issue

Post by PB »

I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
J. Baker
Addict
Addict
Posts: 2196
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: Game Code Issue

Post by J. Baker »

LOL, that's actually good practice. Since I don't have a rubber duck, I wonder if "crazy dog who pees on my floor from time to time debugging" will work the same. :lol:
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
Nituvious
Addict
Addict
Posts: 1030
Joined: Sat Jul 11, 2009 4:57 am
Location: United States

Re: Game Code Issue

Post by Nituvious »

J. Baker wrote:
LOL, that's actually good practice. Since I don't have a rubber duck, I wonder if "crazy dog who pees on my floor from time to time debugging" will work the same. :lol:
I used to do this with my Itty Bitty Shitty Kitty(he used to fall into the toilet a lot..), but he has been missing for several weeks now :cry:
▓▓▓▓▓▒▒▒▒▒░░░░░
User avatar
J. Baker
Addict
Addict
Posts: 2196
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: Game Code Issue

Post by J. Baker »

Nituvious wrote:
J. Baker wrote:
LOL, that's actually good practice. Since I don't have a rubber duck, I wonder if "crazy dog who pees on my floor from time to time debugging" will work the same. :lol:
I used to do this with my Itty Bitty Shitty Kitty(he used to fall into the toilet a lot..), but he has been missing for several weeks now :cry:
LOL but I'm sorry to hear your cat is missing.
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
Post Reply