Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


moving a sprite?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-25-2007, 01:10 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 316
Wink moving a sprite?

My Lunar Lander project.

1) Where can I find a bitmap editor to map my 16x16 lunar lander spacecraft?

2) Then how do I do print at (x,y) my lunar_lander.bmp

I have already done lunar lander with a spaceship drawn out of lines and circles - wow what a game lol! but I think it may be better with a bitymap if I can move that a pixel at a time?
Reply With Quote
  #2 (permalink)  
Old 11-25-2007, 02:27 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,778
Default

2) You can use an Image control and change its Left and Top properties, or you can draw the bitmap on the form's fore layer (Form1.FDrawImage) and erase the old bitmap with Form1.FErase each time.
Reply With Quote
  #3 (permalink)  
Old 11-26-2007, 07:44 AM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 316
Default

Using the image control to move the spaceship worked good. Not having to erase it before a move is great.
2 more questions

1) If my spaceship is on a white background, is there a way to make this white transparent so I can see the backdrop through it?

2) Whats the best way to scroll a screen as in a 'scrambler'/'defender' type arcade game?
Reply With Quote
  #4 (permalink)  
Old 11-26-2007, 11:11 AM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 448
Default

Q1) If you want to set your background as white then I recommend using a different colour background for the spaceship (say magenta) and then this will be the transparent colour.

Q2) I don't think it is the screen that scrolls, I'm pretty sure it is just an image in the background that is larger than the form and as this is moved from right to left it gives the perseption that the ship is fying.

Regards,
Randomcoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #5 (permalink)  
Old 11-26-2007, 11:57 AM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 316
Default

Thanks - maybe I didnt explain about the white properly

My picture of a spaceship 16x16 bitmap is on a white background

The backdrop on the screen is the lunar landscape and night sky - all different coulours.

How do I make the white in the image transparent, so the backdrop shows thro where the spaceship sprite has white space in it? Can u give me the command to use? do I set this in the code, or in the properties of the image box?
Reply With Quote
  #6 (permalink)  
Old 11-26-2007, 01:20 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,778
Default

You could use an ImageButton and set its Enabled property to false.
ImageButtons (unlike Image controls) support transparency.
You could also draw the image on the fore layer instead of using a control.
Reply With Quote
  #7 (permalink)  
Old 11-27-2007, 03:14 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 316
Default

After Ive landed the lunar lander, I called App_start to have another go at the game.
this does not reset the variables (i.e. re run global) or clear the screen

Is there a better way to rerun the program right from the start, like a Run command.

p.s. is there a clear screen command like CLS on my ZX81 ?
Reply With Quote
  #8 (permalink)  
Old 11-27-2007, 04:10 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,778
Default

You should reset the variables manually.
Clearing the screen can be done by calling Form1.Color = Form1.Color, or by loading the background image again.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
the background and sprite GallyHC Questions & Help Needed 4 06-01-2008 02:21 PM
Diff GPS values without moving GPS mouse Georg Questions & Help Needed 1 04-22-2008 06:58 AM
Sprite (gif) Editor MM2forever Questions & Help Needed 0 04-04-2008 06:16 PM
How to create sprite/ moving figures? Stellaferox Questions & Help Needed 11 05-17-2007 06:05 PM
Error when moving treeview to a tabcontrol Peter Questions & Help Needed 2 05-15-2007 06:36 AM


All times are GMT. The time now is 11:44 PM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0