Tweak4141,
skimming through your Sprite project, some thoughts/advice:
- consider SetSpriteShape(ID,3) on the player and egg sprites for more-accurate checks.
- making sure that you know that using GetVirtualWidth/Height() as you are, you are checking against 1 pixel beyond the Screen's Right/Bottom borders. it's a minor issue and i do it all the time myself but it's our bad habit.
- during gameplay, you're allowing the player to (somewhat) "leave" the screen and then moving it back to completely within the screen bounds in the next iteration while it's best to make sure it's in bounds before you SetSpritePosition().
- instead of:
function getRandomCoordinates(a ref as coordinate_pair, id)
Random_X = random(0, GetVirtualWidth() - GetSpriteWidth(id))
Random_Y = random(0, GetVirtualHeight() - GetSpriteHeight(id))
a.x = Random_X
a.y = Random_Y
endfunction
why not:function getRandomCoordinates(a ref as coordinate_pair, id)
a.x = random(0, GetVirtualWidth() - GetSpriteWidth(id))
a.y = random(0, GetVirtualHeight() - GetSpriteHeight(id))
endfunction
- instead of Background and Welcome sprites (1 and 5?), you could SetClearColor()
- +1 for your usage of CHR(10) while setting Text strings. most Newcomers don't.
- while there's nothing wrong with your pikachu movement If/Thens, consider:
Pikachu_Coordinates.x = Pikachu_Coordinates.x + (GetRawKeyState(68)-GetRawKeyState(65))*10
Pikachu_Coordinates.y = Pikachu_Coordinates.y + (GetRawKeyState(83)-GetRawKeyState(87))*10
meanwhile, i can't say i've seen so many Do/Loops with Exit used but whatever works,
works
otherwise, you obviously understand functions which i recommend you use a lot more for efficiency's sake.
IE, how about creating an AddText() function which accepts X, Y, Size, String, R,G,B, Visible parameters?
i've obviously reviewed the shortest of your projects but i urge you to continue experimenting, refining and adding to it. IE, how about:
- increasing the Egg speed each time it hits a wall?
- increasing the Player's Size each time it gets hit by the Egg?
- adding something to Collect and keep Score?
- perhaps PowerUps/Downs that decrease/increase the Player size?
- use SetSpriteFlip() based on the direction the player is moving; a minute detail but i suggest that they matter
...you get it. just pump it full of functionality and squeeze as much FUN out of an otherwise simple premise.
thanks for sharing, and i hope this feedback nudges you to continue coding AND sharing what you're up to