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.

2D All the way! / sprite velocity

Author
Message
mrduck19
20
Years of Service
User Offline
Joined: 29th May 2003
Location:
Posted: 3rd Jun 2003 14:13
can anyone help with simple sprite velocity
i have pseudo which i cant seem to understand why it wont work as it does in other languages i would just like to make a sprite fly across the screen any help would be greatly appreciated
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 3rd Jun 2003 15:12
do
for x= 0 to screen width()
sprite 1,x,screen height()/2,image no
sync
next x
loop
mrduck19
20
Years of Service
User Offline
Joined: 29th May 2003
Location:
Posted: 3rd Jun 2003 15:58
heres my code i have my drawing code working and my player movement all i want is my sprites to randomly fly across the screen i tried implementing flashing blades code but nothing happens do i have something causing a problem?
thanks

Nilrem
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 3rd Jun 2003 17:24
Works for me, how have you set it up Mr Duck?

Take a look at my code below for an example:



I hear and I forget. I see and I remember. I do and I understand.
mrduck19
20
Years of Service
User Offline
Joined: 29th May 2003
Location:
Posted: 3rd Jun 2003 18:03
i eventually got this working looks good i need to loop several of these to give the effect as if many planes are coming over i want to set them with differernt speeds and values and hope to make them bomb the player, my trouble is i cant get them to move, i had it working before with code implemented from a friend but cannot get it to work with my new game, the code before used paste image trouble is this time i want to use sprite collision func
i just want to get started by getting my planes to fly

this is the code used before


mrduck19
20
Years of Service
User Offline
Joined: 29th May 2003
Location:
Posted: 4th Jun 2003 16:51
everything i try either messes with my drawing code for my player or just doesnt work can anyone help with a small snippet to assign a velocity to many different sprites?
cheers


SelethD
20
Years of Service
User Offline
Joined: 1st Jun 2003
Location:
Posted: 4th Jun 2003 17:29
In your situation, you need to find out what is actually causing the problem.

I would suggest making your code simpler, by eliminating all moving objects to 1 object, and see if it will move. If not, try forcing it to 3 different positions on the screen, say with 3 different keypresses, if it doesnt move, then you know some code is constantly setting the coords to its default location. If it does move, then you know that its in your movement calcualtions.

If all else fails, try making the code from scratch not importing from another game, or language.

Happy Coding

Nilrem
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 5th Jun 2003 03:02
Probably worng, but shouldn't it be plane_y instead of y - 5?

I hear and I forget. I see and I remember. I do and I understand.

Login to post a reply

Server time is: 2024-04-24 09:26:51
Your offset time is: 2024-04-24 09:26:51