|
Post by JDTAY on Apr 14, 2004 9:44:55 GMT -5
I'm the guest who made all of the posts under "Guest" in this forum except for the "Basic" topic. I've now registered and made my first program. Tell me if you see any problems with it (besides the horrible sprite design).
[edit]Old code deleted. New code in Reply #6.[/edit]
|
|
oompa loompa
I AM THE GOVERNATOR
"Git 'Er Dun!"
Posts: 1,301
|
Post by oompa loompa on Apr 14, 2004 20:54:05 GMT -5
looking at your source code made me realize that there were errors, on my part =D. mostly it has to do with the expression handling. the code for that was 3000 lines, and i promised myself to never look at it again once i finished it =P. looks like i'll have to dig through it once more =)
but here are the errors: 1) if c then the condition is only true if the lower byte of that expression is not 0. if its something other than 0, then its false. the error on my part is that "c" is a word-length, and its only checking a byte-length, so putting in a value of 256 for c will screw it up =D. for now, doing "if c<>0 then" will fix it
2) if c.0 + c.1 + c.2 + c.3 = 2 then f = 1 that seems very trippy to me. but what i have said in the document, this expression is totally valid. the error on my part is that i jacked up the source code for argunerics. i did ext.w and forgot to add .b to addq. so like, doing that could cause a random error. also, that expression is slow since its executing 5 expressions, it can be optimized =D. you can do:
if c [and] &h000F then f=1
what that does is it clears all the other bits to 0, other than the first 4 bits. if the first 4 bits are not 0, then f=1 is executed.
other than that, everything else looks perfect =D, all those errors will be fixed, yet in the next version
|
|
|
Post by JDTAY on Apr 14, 2004 21:03:02 GMT -5
I don't think I can use tip number 2, I need c.0 + c.1 + c.2 + c.3 to equal exactly 2 in that expression.
I'll try it and get back to you.
|
|
oompa loompa
I AM THE GOVERNATOR
"Git 'Er Dun!"
Posts: 1,301
|
Post by oompa loompa on Apr 14, 2004 21:06:04 GMT -5
you're right XD i thought it said 1 uhm, i'm out of tricks from under my sleeve, you're going to have to use c.0+c.1+......etc for now. if its mandatory, i'll update the compiler source and post a revision of it today
|
|
|
Post by JDTAY on Apr 14, 2004 21:24:01 GMT -5
Thanks for the help. Do you have AIM username that I could contact you at if I wanted to talk about a problem in real time?
|
|
oompa loompa
I AM THE GOVERNATOR
"Git 'Er Dun!"
Posts: 1,301
|
Post by oompa loompa on Apr 14, 2004 21:29:15 GMT -5
i trashed, uninstalled, butchered, and mutiliated my aim =D
the fastest way to contact me are on these boards
|
|
|
Post by JDTAY on Apr 15, 2004 13:13:36 GMT -5
I fixed some more bugs in my program and learned how to use the pallette command. Here's the new version. option title,"Sprite Test" buddy=addsprite(1,1) brght=addsprite(1,1) bleft=addsprite(1,1) bback=addsprite(1,1) pallette rgb(4, 4, 7), 1, 1 pallette rgb(3, 3, 6), 1, 2 pallette rgb(7, 7, 7), 1, 3 loadtiles sprites, 4, 256 propsprite buddy, 256, 1 propsprite brght, 257, 1 propsprite bleft, 258, 1 propsprite bback, 259, 1 movesprite buddy, 200, 200 bposx=200 bposy=200 while 1 c=joypad(0) if c % 16 <> 0 then sleep 1 if g != 0 then movesprite bback, 0, 0 if g != 1 then movesprite buddy, 8, 0 if g != 2 then movesprite bleft, 16, 0 if g != 3 then movesprite brght, 32, 0 f = 0 if c.0 + c.1 + c.2 + c.3 = 2 then f = 1 if c.g = 0 then f = 0 endif if c.0 then bposy-- if f = 0 then g = 0 if g = 0 then movesprite bback, bposx, bposy endif if c.1 then bposy++ if f = 0 then g = 1 if g = 1 then movesprite buddy, bposx, bposy endif if c.2 then bposx-- if f = 0 then g = 2 if g = 2 then movesprite bleft, bposx, bposy endif if c.3 then bposx++ if f = 0 then g = 3 if g = 3 then movesprite brght, bposx, bposy endif wend
sprites: datalong $02222220 datalong $21111112 datalong $23311332 datalong $23011032 datalong $21111112 datalong $21000012 datalong $21111112 datalong $02222220 datalong $02222220 datalong $21111112 datalong $21113312 datalong $21113012 datalong $21111112 datalong $21111002 datalong $21111112 datalong $02222220 datalong $02222220 datalong $21111112 datalong $21331112 datalong $21031112 datalong $21111112 datalong $20011112 datalong $21111112 datalong $02222220 datalong $02222220 datalong $21111112 datalong $21111112 datalong $21111112 datalong $21111112 datalong $21111112 datalong $21111112 datalong $02222220
|
|
oompa loompa
I AM THE GOVERNATOR
"Git 'Er Dun!"
Posts: 1,301
|
Post by oompa loompa on Apr 17, 2004 13:33:07 GMT -5
very nice demo =D
|
|