Moving Sprite Demo |
Yeldarb has just provided some source code he has developed for the PSP. It's an arrow that one can
move around the screen. This requires an
external image, in this case 'arrow.png' and depends on the graphics.h header.
This program loads in a "sprite"
(in this case it's just a simple arrow icon). I have made four frames
of the sprite and put them all on the same image. The code splits
these into separate "images" in an array. Basically, it's a
way to get frames out of a single image (that way you don't have to
mess with a ton of different image files).
The different
frames in this case are different rotations of the arrow sprite. You
can control the arrow with the arrow buttons. Turn the trail of
arrows on and off with the triangle button. Left trigger slows down
the speed, right trigger slows it up. "X" is the gas
button.
Basically, by studying this source code (which,
admittedly, is very simple) you will know how to make a sprite travel
around the screen (bound by the edges), how to erase the image on
subsequent frames, how to control speed, and how to pseudo-rotate a
sprite.
Download: [Moving Sprite Source]
The QJ.net Network |
|
| Site | Feed |
| QJ.NET | RSS |
| Nintendo DS | RSS |
| PlayStation 3 | RSS |
| PSP Updates | RSS |
| Wii | RSS |
| Xbox 360 | RSS |
| MMORPG | RSS |
| Personal Computer Games | RSS |
| iPhone - iPod Touch | RSS |
| QJ.NET Forums | RSS |
Accessories
Add-ons
Applications
Artwork
Batteries
Cheats
Deals
Emulators
Events
Featured Articles
Firmware
Flash Applications
Flash games
Game Demos
Games
Hacks & Exploits
Homebrew Applications
Homebrew Demos
Homebrew Development
Homebrew Emulators
Homebrew Games
Homebrew Themes
How-To
Humor
Imports
Interviews
Magazines
Mods
MY QJ
News
Off Topic
On Shelves This Week
Opinions & Analysis
Podcasts
Previews
PSP Go
PSP Minis
PSP Slim & Lite
QJ How-To Series
QuickJump QuickGuide
QuickJump QuickPeek
Reviews
Rumors
Scans
Screenshots
Site News
Titles
UMD Movies
Videos
Weekend Warrior
Wi-Fi
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
Comments
how run i the "makefile"? with cmd.exe? sorry for my bad english.
I've always wanted to move an arrow around the PSP screen. With this little gem, I can. Can't wait to see it in action W@@T
How to run this on a PSP i dont get the whole thing and how to run. can somebody help me??!
You have to compile the code before you can run it. If you don't know how to do that, then this isnt for you. Head over to the forums and check out the tutorials on how to set up an enviroment so you can compile the code.
It would be better if you could control it with the d-pad, then you can turn the arrow dynamicly... So this isn't a 'great' codesnippet, especially since it's basic c programming...
Its about time someone made a thing like this, ive been waiting for sony to do for ages!! up yours sony the Homebrew scene roxxors more than u! Sprite: Its what the psp was made for.
Nice job Yeldarb, this helps us newbie coders.
@2&6: it's a teaching tool for people who can be bothered to get off their fat asses and actually make something, unlike you
@8: Dweeb
Add New Comment