| View previous topic :: View next topic |
| Author |
Message |
Question_dev
Joined: 24 Aug 2007 Posts: 88
|
Posted: Thu Apr 03, 2008 7:05 am Post subject: Slide image from x, y -> x2, y2 |
|
|
Hi,
I have searched everywhere, but cant find any thread about it.
How do i slide an image from 1 point (x, y) to another (x2, y2) ?
It has to be SLIDING.
I known how to blit images, etc.
Tnx in advance !
Last edited by Question_dev on Thu Apr 03, 2008 8:02 am; edited 1 time in total |
|
| Back to top |
|
 |
hibbyware
Joined: 28 Mar 2007 Posts: 78
|
Posted: Thu Apr 03, 2008 7:23 am Post subject: |
|
|
You don't know how to do that?
If not then you are seriously in the wrong forum, |
|
| Back to top |
|
 |
Question_dev
Joined: 24 Aug 2007 Posts: 88
|
Posted: Thu Apr 03, 2008 7:36 am Post subject: |
|
|
Haha, 2nd april, funny. . . NOT
Sorry, but i'm a beginner. I've learned c a bit, and now i'm trying to code this, but can't figure it out. .
Tnx in advance |
|
| Back to top |
|
 |
hibbyware
Joined: 28 Mar 2007 Posts: 78
|
Posted: Thu Apr 03, 2008 7:42 am Post subject: |
|
|
I think that's the point your missing this is not a beginners help forum,
These type of questions are just cluttering up the section and it makes it harder to find informaton, |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Thu Apr 03, 2008 7:53 am Post subject: |
|
|
Maybe noobs are fed of answers like "get lost!" and coders are sick of questions like "how can i compute the mean of three numbers?"
proposal: can't admins put a "PSP-Noob questions" area?? Maybe this way complex questions will not be lost in a sea of nonsenses..... |
|
| Back to top |
|
 |
Question_dev
Joined: 24 Aug 2007 Posts: 88
|
Posted: Thu Apr 03, 2008 8:01 am Post subject: |
|
|
| Just give me a tip so i can figure it out by myself. |
|
| Back to top |
|
 |
Pirata Nervo
Joined: 09 Oct 2007 Posts: 409
|
Posted: Thu Apr 03, 2008 8:07 am Post subject: |
|
|
You always need a tip _________________
Upgrade your PSP |
|
| Back to top |
|
 |
jo3_sum
Joined: 30 Jan 2008 Posts: 17
|
Posted: Thu Apr 03, 2008 8:18 am Post subject: |
|
|
| Question_dev wrote: | | Just give me a tip so i can figure it out by myself. |
heres a tip:
know exactly what you want and you try figuring out how that will work. |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Thu Apr 03, 2008 8:23 am Post subject: |
|
|
xi,yi = initial coords
xf, yf = final coords
x, y = current coords
| Code: |
float speed = 0.01;
float k;
for (k = 0; k<=1; k+=speed){
x = (int) (xi*(1-k)+xf*(k));
y = (int) (yi*(1-k)+yf*(k));
// ...blit image at x,y...
} |
...not to say that to do a GOOD animation code, this is only a bare hint...
PS: in future, PLEASE refer to one of the billion tutorials about game programming around....if you cannot do it on a PC, this doesn't mean you can do it on a PSP
Last edited by jean on Thu Apr 03, 2008 8:24 am; edited 1 time in total |
|
| Back to top |
|
 |
cruisx
Joined: 25 Mar 2008 Posts: 8
|
Posted: Thu Apr 03, 2008 8:24 am Post subject: |
|
|
| jean wrote: | Maybe noobs are fed of answers like "get lost!" and coders are sick of questions like "how can i compute the mean of three numbers?"
proposal: can't admins put a "PSP-Noob questions" area?? Maybe this way complex questions will not be lost in a sea of nonsenses..... |
I second that =\ there should be a beginners section |
|
| Back to top |
|
 |
jsharrad
Joined: 20 Oct 2005 Posts: 102
|
Posted: Thu Apr 03, 2008 9:42 am Post subject: |
|
|
http://www.google.com/search?hl=en&q=programming+beginner+forum
Lots of beginners "sections" already out there, I'm sure they're more than willing to help you with your simple questions.
I was under the impression this forum was for information specific to the PSP platform, whereas something like moving a sprite from point A to point B is more generic coding. |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Thu Apr 03, 2008 11:21 am Post subject: |
|
|
Well, if there were a beginner's forum, at least that should help cut down on threads to ignore. The problem would be that ignoring the beginner's forum would lead them to post in the regular forums anyway when they see the beginner's forum being ignored. So it may or may not help any.
Other than pissing off noobies, the current method of scorn and ridicule works pretty well, so any idea to replace it would have to do a better job of cutting down the number of noobie threads in the forums we care about. |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Thu Apr 03, 2008 7:05 pm Post subject: |
|
|
| J.F. wrote: | | The problem would be that ignoring the beginner's forum would lead them to post in the regular forums anyway when they see the beginner's forum being ignored. |
I would not bet on it.... there's always someone who wants some free glory boasting of his superiority in middle of poors; aside from this, maybe a noob is better than another (even remaining a noob) and can answer while learning. If there's an arbitrary rule ("no noob questions in dev forum"), it will be more easy to say "wrong place" without the need to be unkind, and saying to change section in a forum sounds better than "change forum"... |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Thu Apr 03, 2008 7:31 pm Post subject: |
|
|
| Possibly. Won't know unless it gets tried. I'll leave the decision to the folks in charge. :) |
|
| Back to top |
|
 |
jbit Site Admin

Joined: 28 May 2005 Posts: 293 Location: København, Danmark
|
Posted: Thu Apr 03, 2008 9:18 pm Post subject: |
|
|
| jean wrote: | Maybe noobs are fed of answers like "get lost!" and coders are sick of questions like "how can i compute the mean of three numbers?"
proposal: can't admins put a "PSP-Noob questions" area?? Maybe this way complex questions will not be lost in a sea of nonsenses..... |
This site isn't geared to beginners, there are many other places on the internet to learn basic programming.
ps2dev.org as a community is for PSP/PS2/PS3 development questions, not general development ones... As I've said before just because the code you're writing happens to be running on the PSP doesn't make it PSP code. Having said that advanced optimization techniques that aren't necessarily PSP related (and other such topics) are appropriate here.
The general ethos that used to exist in the ps2dev.org community before the PSP happened was that you should learn how to code relatively well before even stepping foot on a console, this seems to have been diluted now.
Also, holding hands isn't a good way to teach developers, it's more important for a developer to learn how to figure things out for themselves than to know how to move a sprite on screen. If they can't be bothered to do this, that's their problem.
(Yes this is a rant) |
|
| Back to top |
|
 |
Jim

Joined: 02 Jul 2005 Posts: 487 Location: Sydney
|
Posted: Thu Apr 03, 2008 9:29 pm Post subject: |
|
|
pseudo code
| Code: |
steps = 10
dx = (endx - startx) / steps
dy = (endy - starty) / steps
x = startx
y = starty
for c = 0 to steps
draw(x,y)
x += dx
y += dy
next
|
Jim _________________ http://www.dbfinteractive.com |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Thu Apr 03, 2008 10:02 pm Post subject: |
|
|
@jBit:
Don't tell me....i agree! I was only trying to figure it out HOW we can handle the tons of children only wanting to do something "cool" on their psp....
@jim:
UUUUUUUUUUUHHH... you optimized my code!!! Awesome!.....just kidding |
|
| Back to top |
|
 |
Jim

Joined: 02 Jul 2005 Posts: 487 Location: Sydney
|
|
| Back to top |
|
 |
|