Quick Jump Daily Digest

Thank you for your interest in the Quick Jump Daily Digest. Get notified of all new content on QJ in our free Daily Digest. To subscribe, enter your email address below and click the subscribe button.


Email Address:


Email will come from "donotreply@caputomedia.com". Please whitelist this email address.

Cancel and Return to page

Moving Sprite Demo

Posted May 18, 2006 at 7:54PM EST by QJ Staff

Listed in: Homebrew Applications, Homebrew Demos Tags: psp homebrews, yeldarb
Ó

PSPYeldarb 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]





This story sucks? This story rocks!
Vote Now!    This story ROCKS! (0) This story SUCKS!! (0)




Become a Member of QJ.Net!

If you want your comments to go live without waiting for moderation, you need to be logged in. Being logged in has its benefits:
  • Logged in members do not wait for their comments to be approved.
  • Logged in members can sign up for nightly updates.
  • Logged in members can create Profiles to be seen by other users.
So why wait? Create an account or login now! It's easy, quick, and free.

To get started, use the LOGIN boxes, or the REGISTER link at the top right!

Comments 


 
# eboot.pbp?Guest 2006-05-18 22:16
how run i the "makefile"? with cmd.exe?

sorry for my bad english.

Reply
 

 
# Yeah. ..Guest 2006-05-18 22:21
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

Reply
 

 
# How...?Guest 2006-05-18 23:05
How to run this on a PSP i dont get the whole thing and how to run.

can somebody help me??!

Reply
 

 
# running the fileF34R 2006-05-19 01:47
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.

Reply
 

 
# Hmm....Spessi 2006-05-19 04:06
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...

Reply
 

 
# Great StuffGuest 2006-05-19 04:07
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.

Reply
 

 
# ThanksGuest 2006-05-19 10:01
Nice job Yeldarb, this helps us newbie coders.

Reply
 

 
# PratsGuest 2006-05-20 00:44
@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

Reply
 

 
# ...Guest 2006-05-20 03:21
@8: Dweeb

Reply
 

Add comment

Security code
Refresh


Welcome to QJ.Net!

If you want your comments to go live without waiting for moderation, you need to be logged in. Being logged in has its benefits:
  • Logged in members do not wait for their comments to be approved.
  • Logged in members can create Profiles to be seen by other users.
So why wait? Create an account or login now! It's easy, quick, and free.

To get started, use the LOGIN boxes, or the REGISTER link below!



Want to learn more about the team who brings you the QJ news?

Read about them now!


RSS Feeds Follow us on Twitter Find us on Facebook
Login:

HOT FLASH GAMES

Monster Truck Jumper

Left to Die

The Empire 2

Dark Dimension

Town Drift Competition

Heroes of the Sword