Author |
Message |
|
Graeli
Advanced Member
Joined: 21 Mar 2007 Posts: 420
|
Posted: 09 Apr 2007 06:35:03 pm Post subject: |
|
|
Code: 30üX:30üY
ClrDraw
ClrHome
real(1,X,Y,1,8,0,1,0,0,0,1
Lbl A
While 1
getKey
If Ans=25:Then
ClrDraw
real(1,X,Y,1,8,0,9,8,0,0,1
Y-1üY
real(1,X,Y,1,8,0,1,0,0,0,1
End
If Ans=34:Then
ClrDraw
real(1,X,Y,1,8,0,9,8,0,0,1
Y+1üY
real(1,X,Y,1,8,0,1,0,0,0,1
End
If Ans=24:Then
ClrDraw
real(1,X,Y,1,8,0,9,8,0,0,1
X-1üX
real(1,X,Y,1,8,0,1,0,0,0,1
End
If Ans=26:Then
real(1,X,Y,1,8,0,9,8,0,0,1
X+1üX
real(1,X,Y,1,8,0,1,0,0,0,1
End
End
|
|
Back to top |
|
|
Graeli
Advanced Member
Joined: 21 Mar 2007 Posts: 420
|
Posted: 09 Apr 2007 07:14:49 pm Post subject: |
|
|
Ok, I changed the spr_method to xor, and it fixed the crazy thing that kept making streaks wherever you moved, but the pic is still displayed, and I can only go so far across the screen and up.
Sorry about the DP
Last edited by Guest on 09 Apr 2007 07:17:42 pm; edited 1 time in total |
|
Back to top |
|
|
Harrierfalcon The Raptor of Calcs
Super Elite (Last Title)
Joined: 25 Oct 2006 Posts: 2535
|
Posted: 09 Apr 2007 07:15:26 pm Post subject: |
|
|
Well, I can say for one that the "0" after the "1,8" is the pic, and that there is no such thing as pic 0. Although there is a Pic0, this is actually pic 10 according to xLIB.
On a side note, you don't have to set spr_updateLCD unless you don't want to update it--if omitted, it is assumed to be "1".
EDIT: Try to avoid doubleposting. While it is acceptable under certain circumstances, avoid it otherwise. Use the "EDIT" button near the lower-right hand corner of your post.
Last edited by Guest on 09 Apr 2007 07:16:53 pm; edited 1 time in total |
|
Back to top |
|
|
Graeli
Advanced Member
Joined: 21 Mar 2007 Posts: 420
|
Posted: 09 Apr 2007 07:29:47 pm Post subject: |
|
|
I figured out how to fix the screen (by clearing the graph, recalling the pic, then clearing it again before going to the actual game) I'm still not able to move freely though.
So could someone help m out? Whenever you get so far to the left you bouc off a "wall".
Last edited by Guest on 10 Apr 2007 05:51:36 pm; edited 1 time in total |
|
Back to top |
|
|
luby I want to go back to Philmont!!
Calc Guru
Joined: 23 Apr 2006 Posts: 1477
|
Posted: 14 Apr 2007 07:13:24 am Post subject: |
|
|
I see something that will be bad. your getkey is storing to ans right?
[font="courier new;font-size:9pt;line-height:100%;color:darkblue"]
30→X:30→Y
ClrDraw
ClrHome
real(1,X,Y,1,8,0,1,0,0,0,1
Lbl A
While 1
getKey //let's say getkey is 25 ans=25
If Ans=25:Then
ClrDraw
real(1,X,Y,1,8,0,9,8,0,0,1
Y-1→Y //ans is now y-1
real(1,X,Y,1,8,0,1,0,0,0,1
End
If Ans=34:Then //if y-1=34 then bug :sick:
ClrDraw
real(1,X,Y,1,8,0,9,8,0,0,1
Y+1→Y
real(1,X,Y,1,8,0,1,0,0,0,1
End
If Ans=24:Then
ClrDraw
real(1,X,Y,1,8,0,9,8,0,0,1
X-1→X
real(1,X,Y,1,8,0,1,0,0,0,1
End
If Ans=26:Then
real(1,X,Y,1,8,0,9,8,0,0,1
X+1→X
real(1,X,Y,1,8,0,1,0,0,0,1
End
End
Try storing the getkey to theta or something |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 14 Apr 2007 07:32:32 am Post subject: |
|
|
Why not optimize it to:[font="courier new;font-size:9pt;line-height:100%;color:darkblue"]getKey→K
real(1,X,Y,1,8,0,9,8,0,0,1
Y-(K=25)+(K=34→Y
X-(K=24)+(K=26→X
real(1,X,Y,1,8,0,1,0,0,0,1
End
If you're concerned about flickering, then this should take care of that:[font="courier new;font-size:9pt;line-height:100%;color:darkblue"]getKey→K
X→U:Y→V
Y-(K=25)+(K=34→Y
X-(K=24)+(K=26→X
real(1,U,V,1,8,0,9,8,0,0,1
real(1,X,Y,1,8,0,1,0,0,0,1
End
Last edited by Guest on 15 Jun 2007 02:58:59 am; edited 1 time in total |
|
Back to top |
|
|
Harrierfalcon The Raptor of Calcs
Super Elite (Last Title)
Joined: 25 Oct 2006 Posts: 2535
|
Posted: 14 Apr 2007 10:17:47 am Post subject: |
|
|
Actually, if you use xLIB, you'd know (no offense, Goose) about the last argument, "Spr_UpdateLCD". Set this to 0 for the first sprite, and only when the second sprite is drawn will the effects from the first sprite be seen. |
|
Back to top |
|
|
Graeli
Advanced Member
Joined: 21 Mar 2007 Posts: 420
|
Posted: 16 Apr 2007 03:15:03 pm Post subject: |
|
|
I have a basic understanding of xLib right now, but if you have a sprite which you have over the whole screen: for example grass, but you want your character to move around the screen without erasing the grass, how would you do that. |
|
Back to top |
|
|
vuurrobin
Advanced Member
Joined: 09 Aug 2006 Posts: 428
|
|
Back to top |
|
|
Harrierfalcon The Raptor of Calcs
Super Elite (Last Title)
Joined: 25 Oct 2006 Posts: 2535
|
Posted: 16 Apr 2007 04:36:05 pm Post subject: |
|
|
I don't think the Wiki clarified this very clearly, but by XOR logic, you can simply XOR a sprite, and then XOR it again to revert the background to its original state.
XOR simply stands for "Exclusive OR", which means that it will only be true if ONE OR THE OTHER is true, not both. Take a look:
01001010 [The background]
01101011 [The sprite]
-----------
00100001 [The result]
01101011 [The sprite again]
-----------
01001010 [Guess what? The background!] |
|
Back to top |
|
|
luby I want to go back to Philmont!!
Calc Guru
Joined: 23 Apr 2006 Posts: 1477
|
Posted: 20 Apr 2007 07:09:17 am Post subject: |
|
|
Wouldn't ORing it on and ANDing the background on work also?
%10101010 background
%00011100 sprite
%10111110 sprite on background
%10101010 ANDing
%10101010 Result TADAA!! |
|
Back to top |
|
|
calc84maniac
Elite
Joined: 22 Jan 2007 Posts: 770
|
Posted: 20 Apr 2007 07:13:29 am Post subject: |
|
|
But where would the background get saved? |
|
Back to top |
|
|
Harrierfalcon The Raptor of Calcs
Super Elite (Last Title)
Joined: 25 Oct 2006 Posts: 2535
|
Posted: 20 Apr 2007 03:47:00 pm Post subject: |
|
|
If you were using a matrix or something similar, the spot would be contained that the guy is in.
I still like XOR'ing, but I suppose luby's method would be effective in certain cases as well. |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 20 Apr 2007 05:32:10 pm Post subject: |
|
|
it would work for background tiles for which you know what's going to be there. But, for those you can just use the overwrite mode to paste it back in there.
The problem here is that ORing the character will produce unwanted transparency in places. |
|
Back to top |
|
|
|