Jump to content



0

Help with Pfread


13 replies to this topic

#1 Master_Programmer OFFLINE  

Master_Programmer

    Chopper Commander

  • 182 posts
  • Beep Boop, son, Beep Boop.
  • Location:Fillydelphia

Posted Thu Mar 24, 2011 12:25 PM

Okay, every time i use pfread, and the little formula to convert player x to field x, my player floats a few pixels above the ground.

what am i doing wrong?

Attached Files



#2 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Thu Mar 24, 2011 1:19 PM

If nobody has time to help, I'll look at it and see if I can do anything later tonight. I have to go mow the yard now.

#3 Master_Programmer OFFLINE  

Master_Programmer

    Chopper Commander

  • 182 posts
  • Beep Boop, son, Beep Boop.
  • Location:Fillydelphia

Posted Thu Mar 24, 2011 1:26 PM

View PostRandom Terrain, on Thu Mar 24, 2011 1:19 PM, said:

If nobody has time to help, I'll look at it and see if I can do anything later tonight. I have to go mow the yard now.

I know how that goes.

I hope mowing goes quick and easy for you today. :)

#4 RevEng OFFLINE  

RevEng

    River Patroller

  • 2,010 posts
  • bit shoveler
  • Location:Canada

Posted Thu Mar 24, 2011 5:01 PM

View PostMaster_Programmer, on Thu Mar 24, 2011 12:25 PM, said:

Okay, every time i use pfread, and the little formula to convert player x to field x, my player floats a few pixels above the ground.

what am i doing wrong?
Two things...

1) you initialize player0x=10, and then set pfx=player0x-16. This results in pfx being a negative number, which causes the pfread to read memory from the wrong coordinates.

2) the pfy adjustments you're doing before and after the pfread aren't necessary.

...removing the pfread adjustments and setting player0x greater than 15 causes your guy to fall down until he hits the playfield.

#5 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Thu Mar 24, 2011 6:48 PM

This may not be the best way to do it, but it seems to work:

Attached File  mp_game_2011y_03m_24d_2043t.bas   2.41K   30 downloads

Attached File  mp_game_2011y_03m_24d_2043t.bin   32K   39 downloads

#6 Master_Programmer OFFLINE  

Master_Programmer

    Chopper Commander

  • 182 posts
  • Beep Boop, son, Beep Boop.
  • Location:Fillydelphia

Posted Fri Mar 25, 2011 8:06 AM

Thanks a ton!!
Now i can use *GOOD* collision detection!

My first game had really crappy collision detection, so i wanted to make the sequel have good collision detection. :D

#7 Master_Programmer OFFLINE  

Master_Programmer

    Chopper Commander

  • 182 posts
  • Beep Boop, son, Beep Boop.
  • Location:Fillydelphia

Posted Fri Mar 25, 2011 8:10 AM

O.o

How do the "temp" variables work??

#8 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Fri Mar 25, 2011 8:34 AM

View PostMaster_Programmer, on Fri Mar 25, 2011 8:10 AM, said:

O.o

How do the "temp" variables work??
Check out the third paragraph here:

http://www.randomter....html#variables

I was just playing with the code I added to your program and I have the little guy jumping around on platforms. I'll post what I did later today.

#9 Master_Programmer OFFLINE  

Master_Programmer

    Chopper Commander

  • 182 posts
  • Beep Boop, son, Beep Boop.
  • Location:Fillydelphia

Posted Fri Mar 25, 2011 9:04 AM

View PostRandom Terrain, on Fri Mar 25, 2011 8:34 AM, said:

View PostMaster_Programmer, on Fri Mar 25, 2011 8:10 AM, said:

O.o

How do the "temp" variables work??
Check out the third paragraph here:

http://www.randomter....html#variables

I was just playing with the code I added to your program and I have the little guy jumping around on platforms. I'll post what I did later today.

Nice!!

thanks!

I have one last request, and this isn't aimed at you unless you can, but i need someone who can do 1 channel music. i need someone who's good at making music that isn't "Mary had a little lamb" of other crap like that... >.>

Edited by Master_Programmer, Fri Mar 25, 2011 9:05 AM.


#10 Master_Programmer OFFLINE  

Master_Programmer

    Chopper Commander

  • 182 posts
  • Beep Boop, son, Beep Boop.
  • Location:Fillydelphia

Posted Fri Mar 25, 2011 9:10 AM

D:

I just realized....i can't use pfread if i use the multisprite kernel.......

#11 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Fri Mar 25, 2011 9:37 AM

View PostMaster_Programmer, on Fri Mar 25, 2011 9:10 AM, said:

D:

I just realized....i can't use pfread if i use the multisprite kernel.......
People either use one enemy at a time or use flicker to have more enemies.

#12 Master_Programmer OFFLINE  

Master_Programmer

    Chopper Commander

  • 182 posts
  • Beep Boop, son, Beep Boop.
  • Location:Fillydelphia

Posted Fri Mar 25, 2011 9:38 AM

View PostRandom Terrain, on Fri Mar 25, 2011 9:37 AM, said:

View PostMaster_Programmer, on Fri Mar 25, 2011 9:10 AM, said:

D:

I just realized....i can't use pfread if i use the multisprite kernel.......
People either use one enemy at a time or use flicker to have more enemies.

yeah, but i'm a bit of a newbie, and have no clue how that works.

#13 Master_Programmer OFFLINE  

Master_Programmer

    Chopper Commander

  • 182 posts
  • Beep Boop, son, Beep Boop.
  • Location:Fillydelphia

Posted Fri Mar 25, 2011 9:57 AM

Okay, so far.

#1, i need help with music....i have NO musical talent whatsoever. all i'm asking for, is 1 channel music, that isn't crap like "Mary had a little lamb".

#2, I need to find out how to use more than 2 player objects without losing pfread.

Edited by Master_Programmer, Fri Mar 25, 2011 9:58 AM.


#14 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Fri Mar 25, 2011 10:02 AM

View PostMaster_Programmer, on Fri Mar 25, 2011 9:38 AM, said:

yeah, but i'm a bit of a newbie, and have no clue how that works.
Once you spend a little time checking out the bB forum and the bB page, it will get easier.


Here's the fake gravity platform test program I made today based on the collision code I did yesterday:

Attached File  mp_fake_gravity_by_random_terrain_2011y_03m_25d_1140t.bin   32K   38 downloads


If you are kind of a newbie, I'm not sure I should show you the code yet. My confusing, bloated code might make your brain explode.

I messed around with batari's platformer code that uses complicated math, but I've been meaning to write my own platformer style code. Never got around to it until now. That collision detection code I did yesterday got me in the mood to try my own platformer type of code. It's not perfect and it could use some tweaking, but it's pretty good for not using complicated math. When I get done with the seaweed game I'm working on now, I'll rip my code out of your program and use it in my own platform game.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users