Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ikemike

Pages: 1 ... 3 4 [5]
61
Axe / Re: Need code help with Sprites
« on: March 16, 2010, 11:45:06 pm »
Would I need to append a 0000000000000000 to a hex code, or is that the default?
Also, I'd really like some help with the flicker problem...

62
Axe / Re: Need code help with Sprites
« on: March 16, 2010, 11:37:41 pm »
The problem is, it might have been a completely different sprite, and then it would only erase a portion of the sprite. Of course, I might be wrong. Does it slow the program down?
Also, that doesn't help me for making the sprites not flicker.

63
Axe / Re: Need code help with Sprites
« on: March 16, 2010, 11:30:17 pm »
Not quite... This is all in context, so here's the whole of it:

Code: [Select]
ClrHome
ClrDraw
DiagnosticOff
'DOWN
[3C245A42A5A55A663C245A42A5A55E603C245A42A5A55A663C245A42A5A57A06→Pic1
'RIGHT
[3824445858582838382444586C6894EC3824445858582838382444585C4894EC→Pic2
'LEFT
[1C24221A1A1A141C1C24221A361629371C24221A1A1A141C1C24221A3A122937→Pic3
'UP
[3C244242A5A55A663C244242A5A55E603C244242A5A55A663C244242A5A57A06→Pic4
1→A
1→B
0→X
Pt-On(A,B,Pic1

While getKey(15)=0
If getKey=0
If D=1:Pt-On(A,B,Pic1)End
If D=2:Pt-On(A,B,Pic2)End
If D=3:Pt-On(A,B,Pic3)End
If D=4:Pt-On(A,B,Pic4)End
End
Pause 100
DispGraph
X+1→X
If X=20:0→XEnd
If getKey(1)=1
B+1→B
1→D
ClrDraw
Pt-On(A,B,X/5*8+Pic1
End
If getKey(2)=1
A-1→A
2→D
ClrDraw
Pt-On(A,B,X/5*8+Pic3
End
If getKey(3)=1
A+1→A
3→D
ClrDraw
Pt-On(A,B,X/5*8+Pic2
End
If getKey(4)=1
B-1→B
4→D
ClrDraw
Pt-On(A,B,X/5*8+Pic4
End
End

64
Axe / Re: Need code help with Sprites
« on: March 16, 2010, 11:21:46 pm »
Sorry, I was afraid people might not have noticed it.
Now the sprites flicker... I have this now:

If getKey=0
If D=1:Pt-On(A,B,Pic1)End
If D=2:Pt-On(A,B,Pic2)End
If D=3:Pt-On(A,B,Pic3)End
If D=4:Pt-On(A,B,Pic4)End
End

Anything wrong with this?

65
Axe / Re: Need code help with Sprites
« on: March 16, 2010, 11:02:20 pm »
Right, right, why didn't I think of that before?... Set a variable during the if statement, and use that.

############################

How do you ask if ANY key is being pressed, instead of a specific key? Is there a way?

(edit: merged close double-post)

66
Axe / Re: Need code help with Sprites
« on: March 16, 2010, 10:49:46 pm »
Hmm... It says in the readme that just getKey is "Expression becomes the last key pressed. It is zero if no keys are pressed.".
I'm trying to say "If (direction button) has been pushed last, and (directional button) is not being pushed at the moment, display (direction-appropriate sprite)".

Since this obviously doesn't work, how else could I do something with the same effect?

67
Axe / Re: Need code help with Sprites
« on: March 16, 2010, 10:32:14 pm »
I'm having some trouble of my own in this bit of code involving sprites... In the (marked as, at least) bolded section, I try to get the sprite to default to the first 8 bits in the pic. It said getKey worked this way in the readme, but it's not working the way I expect it to... Or is "and" glitchy?

It messes up the sprite, which is somewhat disconcerting to me.

Code: [Select]
ClrHome
ClrDraw
DiagnosticOff
'DOWN
[3C245A42A5A55A663C245A42A5A55E603C245A42A5A55A663C245A42A5A57A06→Pic1
'RIGHT
[3824445858582838382444586C6894EC3824445858582838382444585C4894EC→Pic2
'LEFT
[1C24221A1A1A141C1C24221A361629371C24221A1A1A141C1C24221A3A122937→Pic3
'UP
[3C244242A5A55A663C244242A5A55E603C244242A5A55A663C244242A5A57A06→Pic4
1→A
1→B
0→X
Pt-On(A,B,Pic1

While getKey(15)=0
[b]If getKey=1 and getKey(1)≠1:Pt-On(A,B,Pic1)End
If getKey=2 and getKey(2)≠1:Pt-On(A,B,Pic2)End
If getKey=3 and getKey(3)≠1:Pt-On(A,B,Pic3)End
If getKey=4 and getKey(4)≠1:Pt-On(A,B,Pic4)End[/b]
Pause 100
DispGraph
X+1→X
If X=20:0→XEnd
If getKey(1)=1
B+1→B
ClrDraw
Pt-On(A,B,X/5*8+Pic1
End
If getKey(2)=1
A-1→A
ClrDraw
Pt-On(A,B,X/5*8+Pic3
End
If getKey(3)=1
A+1→A
ClrDraw
Pt-On(A,B,X/5*8+Pic2
End
If getKey(4)=1
B-1→B
ClrDraw
Pt-On(A,B,X/5*8+Pic4
End
End

I'm new here, and also a n00b programmer. So yeah.

Pages: 1 ... 3 4 [5]