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.

Help with Sprites and Transparency

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-23-2008, 01:37 PM
Junior Member
 
Join Date: Sep 2008
Posts: 15
Default Help with Sprites and Transparency

Hi Erel,

I have just purchased basic4ppc, up to this point I have been a GLBasic
person as it can compile for multiple Operating Systems.

I have been trying to get my head around Sprites and Transparency in
basic4ppc as they are used in a different way!

GLBasic:
LOADSPRITE "ship.bmp",0
LOADSPRITE "shot.bmp",1
LOADSPRITE "buga.bmp",2
LOADSPRITE "boom.bmp",3



The sprite's are referred to numerically or given names.

// Player
INC playerx, MOUSEAXIS(0)
playerx = MAX(MIN(playerx,600),32)
SPRITE 0, playerx, 456 //sets the ship.bmp position
SHOWSCREEN


The ship.bmp has a background colour of RGB(255,0,128) which is transparent
the sprites in basci4ppc also have transparency bur an image does no seem to
have thia capabillity, the image button is no use for this either as its
transparency is the same as the Form or Panel background colour?


// Invaders
TYPE FOE
x
y
speed = 3
amour = 4
ENDTYPE

LOCAL bugs[] AS FOE



FOREACH bug IN bugs[] / draw the invaders on the screen and animate
INC bug.x, bug.speed
IF bug.x<0 OR bug.x>640
bug.speed = - bug.speed
INC bug.y, 32
ENDIF
NEXT




How would I handle all this in basic4ppc, I will end up with six rows of
invaders, each row will have a score value, top will have the highest score
so I need to know which sprite has been destroyed.

Can I put the sprites in a structure or an Array?

I am not asking you to do the programming for me but I would like more info
on how to controll the sprites within the game.

Regards,
Andrew.
Reply With Quote
  #2 (permalink)  
Old 09-24-2008, 06:29 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,726
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

First I recommend you to go over some Sprites examples:
You can find one under c:\Program Files\Anywhere Software\Basic4ppc Desktop\Samples
And here: http://www.basic4ppc.com/forum/code-...e-library.html

You can use the Control keyword to work with a group of sprites or any other objects.
For example:
Code:
For i = 1 to 10
 Control(
"Sprite" & i, Sprite).X = ...
Next
See this tutorial for more information: http://www.basic4ppc.com/forum/tutor...ipulation.html

BTW, you can also consider using the ImageLib library and handle all the drawing without the Sprite library. This will give you more control.
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
drag sprites cpc6128 Questions (Windows Mobile) 5 03-02-2009 02:39 AM
Manage many sprites serge Questions (Windows Mobile) 3 07-31-2008 09:29 AM
transparency colin9876 Questions (Windows Mobile) 7 11-16-2007 10:03 AM


All times are GMT. The time now is 02:29 AM.


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