Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit/AppGameKit Studio Showcase / foundation for a flappy bird clone? ** WIP **

Author
Message
tasmanian guy
13
Years of Service
User Offline
Joined: 29th Jun 2010
Location: Australia
Posted: 28th Feb 2014 12:54 Edited at: 28th Feb 2014 13:00
Hi everyone,

Thought I would include a very basic flappy bird type game here on the forums.

I am no expert in programming but thought this may be useful for others and provide an opportunity to learn from each other and adapted code from elsewhere.

* Please note there are only pipes on the bottom of the screen but should not be hard to adapt it to add pipes to the top of the screen.



Anyway have fun with it all and perhaps we could all share code to make it better as no doubt there is heaps of opportunity for improvement here and we can learn from each other.

DBPro is the new Amos (I hope)

Attachments

Login to view attachments
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 11th Mar 2014 16:06 Edited at: 11th Mar 2014 16:09
I haven't tried this, but I don't think it will work...

You have...

setspriteposition(greenpipe,xpipe,ypipe)

But, greenpipe is not a sprite, you have this:

greenpipe=loadimage("greenpipe.png")
createsprite(greenpipe)

So you create a sprite, from IMAGE greenpipe, but never actually set the sprite number, or store it, you'd need to make some pipe sprites, maybe an array:

Dim pipes[32]
for p=0 to 31
pipes[p]=createsprite(greenpipe)
next p

Then the pipes array will hold the sprite ID's, and you can just recycle them with an incrementing counter. Like, use a global to store the pipe number, and make a function to increment that and add a pipe at a specified location. I use 2 sprites per 'pipe' actually, one for the top and one for the bottom... makes it easy to set the gap between them.

If your code works right now, then I think it can only be a fluke - like if you added 1 more sprite or image, I think it might just topple over.

I am the one who knocks...

Login to post a reply

Server time is: 2024-02-26 22:10:15
Your offset time is: 2024-02-26 22:10:15