Share My Creation Flappy Marshmallow

m1.jpg 1.jpg 2.jpg 3.jpg

Flappy Marshmallow - FREE NO ADS

Be careful not to burn the marshmallow...
Have fun :)

Link: https://play.google.com/store/apps/details?id=www.sagitalfm.net

many thanx to andymc for his search code :)

m1.jpg
 
Last edited:

andymc

Well-Known Member
Licensed User
Longtime User
I like the floating marshmallow game! I'm really pleased someone has taken my code and improved it to release a game on the Play Store, this is why I release source code.I did a series of Youtube videos a few years ago for the BlitzBasic programming language, the most popular ones were a ten part series on how to write space invaders using Blitz3D. Over the years I've built up a following of nearly 1500 subscribers and have received dozens of emails thanking me for doing the series, and that I enabled people to get into programming the easy way instead of having to learn C++ on their own. this sort of thing really makes programming worth while for me and now I'm using Basic4Android to achieve the same feeling with Android programming. I choose games as they're very popular and anyone can pick them up and use them, what ever they're interests, this isn't always true for applications.
 

ilan

Expert
Licensed User
Longtime User
thank you andymc, your coding is very clean. (too clean for me :confused:)

its very nice that people share there project to help rooky developers create there own games and learn more about developing

some things i couldnot understand like how can i change the size of the marshmallow (bird)? if i change only the image it wont work,
and i try in the code to change (when the bird is creating) the pxl hight and widht still no success

i will play a little with it to understand better how you did it, also i would like to animate the matches (pipes) but dont know
how to do it?! maybe with the animationplus library from informatix?

thank you
 

andymc

Well-Known Member
Licensed User
Longtime User
I load the bird image as one command that loads the bird strip into one bitmap. I then scale each frame of the bitmap into an array of bitmaps to be able to animate the bird, this second part is where I scale the bird images to a different size, using the line:
B4X:
img_Bird(x) = IU.CreateScaledBitmap(img_Bird(x),8.5%x,4%y,True)
You could animate the flame on the pipes by drawing a series of frames for the flame animation and then load them in using a similar fashion as I did here for the bird frames, then just draw them on the screen calculating which frame to draw based on the secs variable value.
 

ilan

Expert
Licensed User
Longtime User
v1.7 is out, including flame animation and burned marshmallow

thanx again andymc, i learned new importent tricks from your search code, like how to use stripimage, scale,...

nice work andymc ;)
 
Last edited:

Beja

Expert
Licensed User
Longtime User
Thanks Ilan, great enhancement of the original work..
Would you please share the code so we can learn from..

Thanks in advance.
 

ilan

Expert
Licensed User
Longtime User
hi everyone

its not really hard to do what i have done

i am using the searcode from andymc

i have added only some simple stuff to it
if you have an specific question just ask and i will try to answer and put the searchcode for it

but i think to put the whole project would be wrong, its much more interesting if you do it yourself :), tell me what you need i will copy/paste the code and share it here

but again i really didnot do much only add an activity (start page with hat selection), animation to flame, change the distance of the matches (pipes) and if your score get higher the distance will be shorter, add hat to the marshmalow, add sounds, made the game a little bit smoother thats it...

to eran:
Can you please post the code on how you make an animation in your flame. Thank you in advance

its working the same like the bird you change the frames only every second update instead of every update (like the bird does)
 

Beja

Expert
Licensed User
Longtime User
tell me what you need i will copy/paste the code and share it here
thanks and I just want to know how to change the picture of the bird to another one.
I understand it is one picture contains a series of pictures identical in width, and split
in code.. but I don't know how to do that,, your help is appreciated.
 

ilan

Expert
Licensed User
Longtime User
thanks and I just want to know how to change the picture of the bird to another one.
I understand it is one picture contains a series of pictures identical in width, and split
in code.. but I don't know how to do that,, your help is appreciated.

hi beja

its very simple

in the code you are loading the picture of the birds

B4X:
'load bird frames

    img_BirdStrip = IU.LoadscaledBitmap(File.DirAssets, "bird.png",-1,-1,True)

then with a loop you add all 12 frames to img_Bird() array:
and for every frame you start to crop (cut) the image in his left position, but first we need to calculate the left position of every frame, how? like this:

i have a strip of 4 birds and every bird has 3 frames so i have 12 images
now every frame is 34 pixel widght (how i know? calculate the lenght of the image strip / 12)

frame 1 would be located in the strip on

left= 0
top =0
widht & hight = are 34

frame2:

left 34
top0
widht & hight are = 34

.....

now in the loop you use the integer x and calculate the left position

frame 1 is x0 that means x*34 = 0 that means left of the first frame would start on 0
frame 2 is x1 that means x*34 = 34 that means left of the second frame would start on 34
.....
and now u know the left of every frame and just crop it

For x = 0 To 11
img_Bird(x) = IU.Crop(img_BirdStrip,x*34,0,34,24) 'crop (cut) the frame on his left location
img_Bird(x) = IU.CreateScaledBitmap(img_Bird(x),8.5%x,4%y,True)
Next

i hope i could help you

**********************

@ilan12041981 whats lib you use to make a fade in splash when start the app ?

sorry dougles but i cannot see any fade animation in my app

do you mean the translate animation of the hat panel? if yes its the ANIMATION PLUS library from informatix
 

Beja

Expert
Licensed User
Longtime User
Thanks for the help, Ilan,

But where can I find the library or function of IU that you are using?
 

ilan

Expert
Licensed User
Longtime User
Top