Author Topic: Trying to get this to work  (Read 9019 times)

0 Members and 1 Guest are viewing this topic.

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Trying to get this to work
« Reply #15 on: October 28, 2011, 08:37:48 pm »
pic into appvar:
(quote from yeongJIN_COOL :))
To Store Pic in appvar:
(just create a temp program to do this)

GetCalc("appvBLAH",768)→A  //appvBLAH created and stored into pointer A
[Pic1]→B //Pic1 in OS Stored into pointer B
Copy(B,A,768) //Copies Pic1 into appvBLAH

put an arrow on the screen? can you elaborate on that? (now I sound like eliza lol ;))
« Last Edit: October 28, 2011, 08:39:01 pm by parser padwan »

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Trying to get this to work
« Reply #16 on: October 28, 2011, 08:39:21 pm »
Do I have to use an appvar? I have an arrow sprite and I just want to display it on the screen

Here's what happens with my code:
« Last Edit: October 28, 2011, 08:41:01 pm by epic7 »

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Trying to get this to work
« Reply #17 on: October 28, 2011, 08:41:08 pm »
of course you don't have to use an appvar.
arrow sprite: Pt-On(X,Y,Pic1)
is that what you need?

EDIT: try doing Fix 5 at the beginning of the program. It might help.
« Last Edit: October 28, 2011, 08:42:38 pm by parser padwan »

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Trying to get this to work
« Reply #18 on: October 28, 2011, 08:42:54 pm »
I used that and it usually works.

I used
Pt-on(x,y,rotC(Pic0)

Offline jacobly

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 205
  • Rating: +161/-1
    • View Profile
Re: Trying to get this to work
« Reply #19 on: October 28, 2011, 08:44:11 pm »
It looks like you were drawing the background over the arrows in the first post, which is why they are not showing up.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Trying to get this to work
« Reply #20 on: October 28, 2011, 08:45:50 pm »
Oh. I just noticed that when I tried to recall my Pic9 background, It was blank, so I must have not even stored the background

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Trying to get this to work
« Reply #21 on: October 28, 2011, 08:46:46 pm »
oh yeah duh :P I am stupid.
doing the pic recall erases it. (the buffer)
do it at the beginning and do storepic, or whatever ;)
« Last Edit: October 28, 2011, 08:47:02 pm by parser padwan »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Trying to get this to work
« Reply #22 on: October 28, 2011, 08:49:49 pm »
hmmm...
my expirience with pics is: DON'T!
I always use appvars, easier to store, recall, and doesn't take up precious pic space.
whenever I use a OS pic, it puts the pixels wherever it wants.

Really?  I use OS Pic's all the time and never have they ever given me any problems.  I think they are also much much more useful than appvars because appvars can't be compiled directly into the code.  And since the picture variables are compiled into the program, you can delete them when you are done, freeing up that precious pic space. 

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Trying to get this to work
« Reply #23 on: October 28, 2011, 08:52:23 pm »
This happened to me twice now. I run the program once, and it works great. Second time, the Pic9 is erased.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Trying to get this to work
« Reply #24 on: October 28, 2011, 08:56:55 pm »
The pictures on the first post don't show the entire program, could you post the entire source in text?

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Trying to get this to work
« Reply #25 on: October 28, 2011, 08:58:23 pm »
Im going to make a few adjustments and then get the code

Edit: Screw it, Im getting the code first

Double Edit: Here is is

Code: [Select]
:.ROBOGUN
:1→G
:[081C2A4908080808]→Pic0
:[F080800000000000]→Pic1
:[FCA0A02000000000]
:[FFFCA0A080000000]
:[FCFFFC4848484000]
:[F8FFFFF848484850]
:[F8FFFFFFFC6C6C6C]
:Repeat getKey(15)
:Text(35,1,"RoboGun")
:Text(42,8,"V1.0"
:Text(1,55,"New Game"
:Text(60,55,"Load Game"
:copy([Pic9],L6,768)
:Pt-On(75,47,ShadeNorm(Pic0)
:Pt-On(12,47,Shade_t(Pic0)
:DispGraph
:End

I think If I put the Text( after the background, it'll stop the blinking of the words a bit, right?
« Last Edit: October 28, 2011, 09:02:05 pm by epic7 »

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Trying to get this to work
« Reply #26 on: October 28, 2011, 09:02:05 pm »
Firstly, to stop the flickering, add a
Code: [Select]
Fix 5
somewhere at the top, and a
Code: [Select]
Fix 4
at the end of the program.

Second, I've never use OS Pic vars before -- is it safe to use a direct [Pic9] inside of a command?

Thirdly, try doing something like
Code: [Select]
[Pic9]->Pic8
outside of the loop then doing
Code: [Select]
Copy(Pic8,L6,768)   .or whatever number
I don't know if that'll do anything, but it seems like it's worth a shot.

Fourthly, a bit random, but I'm assuming that RotC is run at compile time and returns a pointer to the rotated sprite data?  If so, couldn't you dereference that pointer and technically do RotC on it infinitely as long as you don't mind the code bloat?
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Trying to get this to work
« Reply #27 on: October 28, 2011, 09:03:47 pm »
Does
Fix 5 draw text to the buffer or something?

Edit: With fix5, no text shows up.

Edit: Nvm I know why
« Last Edit: October 28, 2011, 09:06:23 pm by epic7 »

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Trying to get this to work
« Reply #28 on: October 28, 2011, 09:05:45 pm »
That's exactly what it does.  Everytime you do a 'DispGraph', you're actually destroying the text on the screen (because there's no text written to the buffer and the blankness overwrites what's on the screen).
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Trying to get this to work
« Reply #29 on: October 28, 2011, 09:09:53 pm »
Will [pic9]-> pic8 hopefully stop the deleting of my background?


Edit: It kinda does.... I compiled and ran multiple times, it worked. I compiled it again and my background was deleted.
« Last Edit: October 28, 2011, 09:22:37 pm by epic7 »