FROGGER GAME (NEED HELP)
FROGGER GAME (NEED HELP)
So for my school project I have to create a video game. I chose the game frogger. So I have to use DATA arrays to make the images or sprites. I have the Image of Frogger, but I'm not sure how to get him to move in the directions needed. I can get him to move, but it keeps the image of the frog at his original position. So I basically get a bunch of copies of a frog all over my screen. I tried CLS, but i dont want to clear the rest of the stage. Any help would be appreciated.
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
Re: FROGGER GAME (NEED HELP)
Are you using a sprite from a BSAVE image? There are a few ways to set it with PUT, but you may need to GET the background area where the sprite WILL GO first.
1) GET a square as large as the sprite at the position of the background the sprite will go and it will be saved to an array.
2) PUT the sprite image in that location using the upper left corner position only.
3) When there is a change in position, PUT the background back then GET the next background position(1).
Odd shaped sprites will need a mask to use over colored backgrounds.
See my Q-basics tutorial below, Chapter 13.
1) GET a square as large as the sprite at the position of the background the sprite will go and it will be saved to an array.
2) PUT the sprite image in that location using the upper left corner position only.
3) When there is a change in position, PUT the background back then GET the next background position(1).
Odd shaped sprites will need a mask to use over colored backgrounds.
See my Q-basics tutorial below, Chapter 13.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Re: FROGGER GAME (NEED HELP)
So what exactly do you mean by the upper left position only? I have it in an array using the get. And if it is an odd shaped sprite. Do you have a link to your tutorial?
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
Re: FROGGER GAME (NEED HELP)
GET needs box coordinates from both TLC and BRC. PUT only uses the TLC coordinates and array name with actions. Cannot be off screen!
PUT [STEP](column, row), Array([index]) [,{PSET|PRESET|AND|OR|XOR}]
The INTEGER array size would be the sprite box width * height for both arrays.
The Q-Basics link is in my signature below.
PUT [STEP](column, row), Array([index]) [,{PSET|PRESET|AND|OR|XOR}]
The INTEGER array size would be the sprite box width * height for both arrays.
The Q-Basics link is in my signature below.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0