Hello LOVE community
I just found this awesome game engine and so far I'm loving it (Pun and Mcdonalds quote not intended )
I just have one question, I figured I should start off small, so I will begin by making a space invaders clone so far its been really easy,
but I was just confused as to how to make the player shoot in only one direction (upwards) when the space bar is pressed, I'm sure this
is fairly simple for you guys but it was confusing to me all the same, so please help me out and post a reply below .
Thank you for your time (and hopefully, your help).
Creating moving objects
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Creating moving objects
You'll need to read the "love.keyboard" section of the guide (it's explained 1000 times better than could i). You have to decide if you want to read keyboard inside your main loop or if you want to register keypresses inside a separate callback. (it's simpler that it could seem).
To move an object up you have simply to decrease the y-coordinate you use to display his sprite.
To move an object up you have simply to decrease the y-coordinate you use to display his sprite.
-
- Prole
- Posts: 2
- Joined: Mon Jan 18, 2010 1:21 am
Re: Creating moving objects
Thank you very much, but how do I create the object?
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Creating moving objects
That depends. You probably don't want to use the built-in physics now. It is awesome, but a little complex. Are you familiar with Lua? If not, I suggest you read a Lua tutorial, and PIL is a good read as well.A_Bloke_101 wrote:Thank you very much, but how do I create the object?
You can just use a table, for example:
Code: Select all
player = {x = 0, y = 0, speed = 0, angle = 0}
Help us help you: attach a .love.
Who is online
Users browsing this forum: No registered users and 3 guests