Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

moving a sprite?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-25-2007, 02:10 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 366
Awards Showcase
Beta Tester 
Total Awards: 1
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, 03:27 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
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, 08:44 AM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 366
Awards Showcase
Beta Tester 
Total Awards: 1
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, 12:11 PM
RandomCoder's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire, UK
Posts: 614
Awards Showcase
Beta Tester 
Total Awards: 1
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
__________________
"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #5 (permalink)  
Old 11-26-2007, 12:57 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 366
Awards Showcase
Beta Tester 
Total Awards: 1
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, 02:20 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
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, 04:14 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 366
Awards Showcase
Beta Tester 
Total Awards: 1
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, 05:10 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create sprite/ moving figures? Stellaferox Questions (Windows Mobile) 14 12-31-2008 09:30 AM
Drawing and moving a Character Transparently (Not a Sprite) Drewpeu Questions (Windows Mobile) 2 10-08-2008 04:15 PM
Diff GPS values without moving GPS mouse Georg Questions (Windows Mobile) 1 04-22-2008 07:58 AM
Sprite (gif) Editor MM2forever Questions (Windows Mobile) 0 04-04-2008 07:16 PM
Error when moving treeview to a tabcontrol Peter Questions (Windows Mobile) 2 05-15-2007 07:36 AM


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


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0